Skip to content
New issue

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

numpy.AxisError: axis 1 is out of bounds for array of dimension 1 #26

Open
Jasonmes opened this issue May 13, 2020 · 2 comments
Open

numpy.AxisError: axis 1 is out of bounds for array of dimension 1 #26

Jasonmes opened this issue May 13, 2020 · 2 comments

Comments

@Jasonmes
Copy link

Jasonmes commented May 13, 2020

Traceback (most recent call last):
File "/home/moziaijason/pycode/detection/pytorch-openpose-master/src/hand.py", line 89, in
canvas = util.draw_handpose(oriImg, peaks, True)
File "/home/moziaijason/pycode/detection/pytorch-openpose-master/src/util.py", line 94, in draw_handpose
if np.sum(np.all(peaks[e], axis=1)==0)==0:
File "<array_function internals>", line 6, in all
File "/home/moziaijason/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 2398, in all
return _wrapreduction(a, np.logical_and, 'all', axis, None, out, keepdims=keepdims)
File "/home/moziaijason/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 90, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
numpy.AxisError: axis 1 is out of bounds for array of dimension 1

util.py

for peaks in all_hand_peaks:
for ie, e in enumerate(edges):
if np.sum(np.all(peaks[e], axis=1)==0)==0:
print(peaks[e])
x1, y1 = peaks[e[0]]
x2, y2 = peaks[e[1]]
ax.plot([x1, x2], [y1, y2], color=matplotlib.colors.hsv_to_rgb([ie/float(len(edges)), 1.0, 1.0]))

当我运行hand.py的时候,出现上面的错误

@xiakj
Copy link

xiakj commented Sep 6, 2021

@Jasonmes 怎么解决的

@JiayuZou2020
Copy link

How to solve this problem? Did you find out the solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants