sketch2pose icon indicating copy to clipboard operation
sketch2pose copied to clipboard

AttributeError: 'SMPLXOutput' object has no attribute 'A'

Open Cicistrawberry opened this issue 3 years ago • 2 comments

When I run this program, the following error occurs.

(pytorch38) D:\python\sketch2pose>python src/pose.py --save-path "./output" --img-path "./data/images" --use-contacts --use-natural --use-cos --use-angle-transf Namespace(bone_parametrization_path='./models/smplx_parametrization/bone_to_param2.npy', c_cont2d=1, c_f=1000, c_msc=17500, c_mse=0, c_par=10, c_parallel=100, c_reg=1000, contact_model_path='./models/contact_hrn_w32_256x192.onnx', device='cuda', essentials_dir='./models/smplify-xmc-essentials', fist=None, foot_inds_path='./models/smplx_parametrization/foot_inds.npy', img_path='./data/images', parametrization_path='./models/smplx_parametrization/parametrization.npy', pose_estimation_model_path='./models/hrn_w48_384x288.onnx', save_path='./output', smpl_mean_params_path='./models/data/smpl_mean_params.npz', smpl_model_dir='./models/models/smplx', smpl_type='smplx', spin_model_path='./models/spin_model_smplx_eft_18.pt', use_angle_transf=True, use_contacts=True, use_cos=True, use_msc=False, use_natural=True)C:\Users\CICI\AppData\Roaming\Python\Python38\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( C:\Users\CICI\AppData\Roaming\Python\Python38\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) D:\software\Anaconda\envs\pytorch38\lib\site-packages\selfcontact\selfcontact.py:109: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor). torch.tensor(hd_operator).float()) Traceback (most recent call last): File "src/pose.py", line 1922, in main() File "src/pose.py", line 1815, in main spin_step( File "src/pose.py", line 1374, in spin_step ) = get_pred_and_data( File "src/pose.py", line 351, in get_pred_and_data rotmat, betas, camera, smpl_output, zz = get_predictions( File "src/pose.py", line 335, in get_predictions smpl_output, rotmat = get_smpl_output( File "src/pose.py", line 319, in get_smpl_output smpl_output = smpl( File "C:\Users\CICI\AppData\Roaming\Python\Python38\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "D:\python\sketch2pose\src\spin\smpl.py", line 236, in forward A=smpl_output.A, AttributeError: 'SMPLXOutput' object has no attribute 'A'


I should point out that I'm using a windows environment, which I don't know if this will matter.

Cicistrawberry avatar Nov 25 '22 16:11 Cicistrawberry

You should patch smplx with smplx.diff. See commands in prepare.sh and adapt for windows

kbrodt avatar Nov 25 '22 16:11 kbrodt

Oh, I got it!! Thank you very much for your answer!!!

Cicistrawberry avatar Nov 25 '22 16:11 Cicistrawberry