RizwanMunawar / yolov7-pose-estimation

YOLOv7 Pose estimation using OpenCV, PyTorch
GNU General Public License v3.0
344 stars 82 forks source link

change a video will get a error, but its works fine with the original video #9

Closed Tonyztj closed 1 year ago

Tonyztj commented 1 year ago

(yolov5) user@user-SYS-7048GR-TR:~/ztj_files/yolov7-pose-estimation-main$ python pose-estimate.py --source smoking_test.mp4 Optimizer stripped from yolov7-w6-pose.pt, 161.1MB Fusing layers... /home/user/anaconda3/envs/yolov5/lib/python3.7/site-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1639180594101/work/aten/src/ATen/native/TensorShape.cpp:2157.) return _VF.meshgrid(tensors, kwargs) # type: ignore[attr-defined] Frame 1 Processing Traceback (most recent call last): File "pose-estimate.py", line 161, in main(opt) File "pose-estimate.py", line 156, in main run(vars(opt)) File "/home/user/anaconda3/envs/yolov5/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context return func(*args, kwargs) File "pose-estimate.py", line 71, in run outputdata, = model(image) File "/home/user/anaconda3/envs/yolov5/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/home/user/ztj_files/yolov7-pose-estimation-main/models/yolo.py", line 514, in forward return self.forward_once(x, profile) # single-scale inference, train File "/home/user/ztj_files/yolov7-pose-estimation-main/models/yolo.py", line 540, in forward_once x = m(x) # run File "/home/user/anaconda3/envs/yolov5/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/home/user/ztj_files/yolov7-pose-estimation-main/models/common.py", line 62, in forward return torch.cat(x, self.d) RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 39 but got size 40 for tensor number 1 in the list.

RizwanMunawar commented 1 year ago

@Tonyztj! Seems like you have an issue with the anaconda environment and Pytorch version. I have not tested the code in an anaconda environment, so I will recommend using python-venv. I have tested it with different video paths, and it's working fine.

Tonyztj commented 1 year ago

@Tonyztj! Seems like you have an issue with the anaconda environment and Pytorch version. I have not tested the code in an anaconda environment, so I will recommend using python-venv. I have tested it with different video paths, and it's working fine.

ok, thank you!