We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This bug is not related to the environment.
This bug is not related to specific code.
This bug is not related to specific command.
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed
In mmpose\evaluation\metrics\coco_metric.py, line 536-537
if isinstance(img_kpt['category_id'], Iterable): img_kpt['category_id'] = img_kpt['category_id'][0]
0-dimensional numpy array with single digit IS an "Iterable" instance, but it IS NOT Iterable So, when there is only one category_id, it raises
Changing "[0]" to ".iter()" won't help, as 0-dimensional array is not iterable, though it is an iterable instance.
TypeError: iteration over a 0-d array
So, we need to change this script to something like this:
if isinstance(img_kpt['category_id'], Iterable): if isinstance(img_kpt['category_id'], np.ndarray): if len(img_kpt['category_id'].shape) == 0: img_kpt['category_id'] = int(img_kpt['category_id']) else: img_kpt['category_id'] = img_kpt['category_id'].flatten()[0] else: img_kpt['category_id'] = img_kpt['category_id'][0]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Prerequisite
Environment
This bug is not related to the environment.
Reproduces the problem - code sample
This bug is not related to specific code.
Reproduces the problem - command or script
This bug is not related to specific command.
Reproduces the problem - error message
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed
Additional information
In mmpose\evaluation\metrics\coco_metric.py, line 536-537
0-dimensional numpy array with single digit IS an "Iterable" instance, but it IS NOT Iterable
So, when there is only one category_id, it raises
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed
Changing "[0]" to ".iter()" won't help, as 0-dimensional array is not iterable, though it is an iterable instance.
So, we need to change this script to something like this:
The text was updated successfully, but these errors were encountered: