pytorch-openpose icon indicating copy to clipboard operation
pytorch-openpose copied to clipboard

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

Open Jasonmes opened this issue 4 years ago • 2 comments

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的时候,出现上面的错误

Jasonmes avatar May 13 '20 06:05 Jasonmes

@Jasonmes 怎么解决的

xiakj avatar Sep 06 '21 02:09 xiakj

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

JiayuZou2020 avatar Nov 10 '21 15:11 JiayuZou2020