Vegetebird / StridedTransformer-Pose3D

[TMM 2022] Exploiting Temporal Contexts with Strided Transformer for 3D Human Pose Estimation
MIT License
335 stars 37 forks source link

ValueError: axes don't match when inference #35

Closed jiali1025 closed 1 year ago

jiali1025 commented 1 year ago

I have encountered this error when want to inference my wild video. And I find I have this problem even for the sample video. I have used the suggested environment of versions of python, cuda and torch. This error comes from the gen_video_kpts.py

Vegetebird commented 1 year ago

Could you please provide all the error messages, the command you are trying to run, information about your GPU, and the command to install PyTorch?

jiali1025 commented 1 year ago

Hi thank you for your reply. The full error message is as follow: Generating 2D pose... 0it [00:00, ?it/s] Traceback (most recent call last): File "demo/vis.py", line 275, in get_pose2D(video_path, output_dir) File "demo/vis.py", line 86, in get_pose2D keypoints, scores = hrnet_pose(video_path, det_dim=416, num_peroson=1, gen_output=True) File "/home/lijiali/projects/StridedTransformer-Pose3D/demo/lib/hrnet/gen_kpts.py", line 163, in gen_video_kpts keypoints = keypoints.transpose(1, 0, 2, 3) # (T, M, N, 2) --> (M, T, N, 2) ValueError: axes don't match array.

The python is 3.6.13 torch is 1.7.1 GPU is 3070 Install command is: conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch

Vegetebird commented 1 year ago

I use the newest release code and provided sample_video.mp4, but it works well.

jiali1025 commented 1 year ago

Could you give me an environment file from conda? so I can try to fix it

Vegetebird commented 1 year ago

I think you should debug the code first, for example, checking the video_path. And if the read image is correct.

jiali1025 commented 1 year ago

I am sure the video_path is correct If your readme instruction is correct. What do you mean by reading images? I think someone mentioned this issue before. And he said it is solved by using python 3.7xx instead of 3.6 on your closed issue. This is why I want to know what the packages and the versions are used by you. Thanks

Vegetebird commented 1 year ago

My environment is: Ubuntu18, Python3.9, torch 1.7.1+cu110 (pip3 install torch==1.7.1+cu110 torchvision==0.8.2+cu110 -f https://download.pytorch.org/whl/torch_stable.html)

jiali1025 commented 1 year ago

I think it is the environment. After upgrade to 3.7 no this error. Thanks. I think 3.9 is not compatible with torch 1.7.1, so maybe 3.7 is best

jiali1025 commented 1 year ago

Could you let me know whether we can get the extracted 3d pose in csv instead of generated pngs. Thanks!

Vegetebird commented 1 year ago

You can refer to https://github.com/Vegetebird/GraphMLP/blob/9c44f4b9f04915c449fd3f2f526b42e170ba3400/demo/vis.py#L253