MVIG-SJTU / AlphaPose

Real-Time and Accurate Full-Body Multi-Person Pose Estimation&Tracking System
http://mvig.org/research/alphapose.html
Other
8.05k stars 1.98k forks source link

AttributeError("'Tensor' object has no attribute 'pred_uvd_jts'") #1059

Open modaresimr opened 2 years ago

modaresimr commented 2 years ago

Thank you for your great work. When i want to use demo_3d_inference.py it shows the following error: AttributeError("'Tensor' object has no attribute 'pred_uvd_jts'") at line 259

All the entries in this dictionary have this problem. Would you please help me?

smpl_output = {
    'pred_uvd_jts': pose_output.pred_uvd_jts.cpu()[new_ids],
    'maxvals': pose_output.maxvals.cpu()[new_ids],
    'transl': pose_output.transl.cpu()[new_ids],
    'pred_vertices': pose_output.pred_vertices.cpu()[new_ids],
}
modaresimr commented 2 years ago

More information: The complete command:

>python3 scripts/demo_3d_inference.py --cfg configs/coco/resnet/256x192_res50_lr1e-3_1x.yaml --checkpoint pretrained_models/fast_res50_256x192.pth --indir examples/demo/ --save_img
site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
  warnings.warn(
site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=ResNet50_Weights.IMAGENET1K_V1`. You can also use `weights=ResNet50_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
Loading pose model from pretrained_models/fast_res50_256x192.pth...
Loading YOLO model..
  0%|                                                                                                        | 0/3 [00:04<?, ?it/s]
AttributeError("'Tensor' object has no attribute 'pred_uvd_jts'")
An error as above occurs when processing the images, please check it

With the other configs:

>python3 scripts/demo_3d_inference.py --cfg configs/smpl/256x192_adam_lr1e-3-res34_smpl_24_3d_base_2x_mix.yaml --checkpoint pretrained_models/pretrained_w_cam.pth --indir examples/demo/ --save_img 
site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
  warnings.warn(
site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=ResNet34_Weights.IMAGENET1K_V1`. You can also use `weights=ResNet34_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
Loading pose model from pretrained_models/pretrained_w_cam.pth...
Loading YOLO model..
  0%|                                                                                                        | 0/3 [00:04<?, ?it/s]
_LinAlgError('cusolver error: CUSOLVER_STATUS_EXECUTION_FAILED, when calling `cusolverDnSgesvdjBatched( handle, jobz, m, n, A, lda, S, U, ldu, V, ldv, static_cast<float*>(dataPtr.get()), lwork, info, params, batchSize)`. This error may appear if the input matrix contains NaN.')
An error as above occurs when processing the images, please check it
Fang-Haoshu commented 2 years ago

Hi,the first command is not correct since you used the coco config. You should use the smpl config for 3d inference. In the second one, it seems the pytorch meet a cusolver error. What pytorch version are you using? Can you try the 2d inference to see if the environment works?