zh-plus / video-to-pose3D

Convert video to 3D pose in one-key.
MIT License
646 stars 130 forks source link

Running videopose.py face error (AttributeError: 'list' object has no attribute 'shape') #39

Closed jellyfish1456 closed 4 years ago

jellyfish1456 commented 4 years ago

Hi there~ Thank you for sharing such great work to us. It is really helpful for many people.

When I run $ python videopose.py below It will show an error message which is (AttributeError: 'list' object has no attribute 'shape') Could you please help me to find out the error Thank you very much!

================================================================================================= the video is 25.051 f/s Loading YOLO model.. /home/xxx/.conda/envs/3d/lib/python3.6/site-packages/torch/nn/modules/upsampling.py:129: UserWarning: nn.Upsample is deprecated. Use nn.functional.interpolate instead. warnings.warn("nn.{} is deprecated. Use nn.functional.interpolate instead.".format(self.name)) Loading pose model from joints_detectors/Alphapose/models/sppe/duc_se.pth Start pose estimation... 100%|█████████████████████████████████████████| 338/338 [00:23<00:00, 14.11it/s] kpts npz save in outputs/alpha_pose_kunkun_cut/kunkun_cut.npz -------------- load data spends 27.51 seconds Loading checkpoint checkpoint/pretrained_h36m_detectron_coco.bin -------------- load 3D model spends 0.02 seconds Rendering... -------------- generate reconstruction 3D data spends 0.15 seconds ===========================> This video get 338 frames in total. 0%| | 0/338 [00:00<?, ?it/s]/home/xxx/video-to-pose3D/common/visualization.py:181: UserWarning: Tight layout not applied. The left and right margins cannot be made large enough to accommodate all axes decorations. fig.tight_layout() 0%|▏ | 1/338 [00:00<00:43, 7.82it/s]outputs/kunkun_cut.mp4 --- elapsed time: 28.11254884302616 s Traceback (most recent call last): File "videopose.py", line 164, in inference_video('outputs/kunkun_cut.mp4', 'alpha_pose') File "videopose.py", line 160, in inference_video main(args) File "videopose.py", line 133, in main input_video_skip=args.viz_skip) File "/home/xxx/video-to-pose3D/common/visualization.py", line 187, in render_animation anim.save(output, writer=writer) File "/home/xxx/.conda/envs/3d/lib/python3.6/site-packages/matplotlib/animation.py", line 1133, in save anim._draw_next_frame(d, blit=False) File "/home/xxx/.conda/envs/3d/lib/python3.6/site-packages/matplotlib/animation.py", line 1168, in _draw_next_frame self._draw_frame(framedata) File "/home/xxx/.conda/envs/3d/lib/python3.6/site-packages/matplotlib/animation.py", line 1718, in _draw_frame self._drawn_artists = self._func(framedata, *self._args) File "/home/xxx/video-to-pose3D/common/visualization.py", line 175, in update_video lines_3d[n][j - 1][0].set_3d_properties([pos[j, 2], pos[j_parent, 2]], zdir='z') File "/home/xxx/.conda/envs/3d/lib/python3.6/site-packages/mpl_toolkits/mplot3d/art3d.py", line 143, in set_3d_properties zs = np.broadcast_to(zs, xs.shape) AttributeError: 'list' object has no attribute 'shape' 0%|▏ | 1/338 [00:00<00:56, 5.99it/s]

zh-plus commented 4 years ago

It may be caused by the incompatibility of matplotlib. I'm using Version 3.1.0, which may help to address this issue. Sorry for the late response.

pyqpyqpyqpyq789 commented 3 years ago

change 'xs' to 'xs_ = np.array(xs)'