vchoutas / smplx

SMPL-X

Home Page:https://smpl-x.is.tue.mpg.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

transfer_model issue : AttributeError: 'Struct' object has no attribute 'hands_componentsl'

HwangGB opened this issue · comments

Hi,

I'm encountering the error message in the title when following this guide for model parameter transfer:
SMPL-X Model Transfer Guide.

I want to transfer SMPL-X male model data to SMPL data, so I modified the write_obj.py code from line 18 to 30 like this:

def main(
    model_folder,
    motion_file,
    output_folder,
    model_type="smplx",
    ext="npz",
    gender="male",
    plot_joints=False,
    num_betas=10,
    sample_expression=True,
    num_expression_coeffs=10,
    use_face_contour=False,
):

I used this command line to break the motion into a set of pose .obj files:

python write_obj.py --model-folder ../models/ --motion-file ../transfer_data/our_data/smplx_test.npz --model-type "smplx" --output-folder ../transfer_data/meshes/test/

However, I encountered this error message:

python write_obj.py --model-folder ../models/ --motion-file ../transfer_data/our_data/smplx_test.npz --model-type "smplx" --output-folder ../transfer_data/meshes/test/
arr_0 ()
male
10
Traceback (most recent call last):
  File "/home/_/_/motion_diary/smplx2smpl/smplx/transfer_model/write_obj.py", line 199, in <module>
    main(
  File "/home/_/_/motion_diary/smplx2smpl/smplx/transfer_model/write_obj.py", line 59, in main
    model = smplx.create(
            ^^^^^^^^^^^^^
  File "/home/_/anaconda3/lib/python3.11/site-packages/smplx/body_models.py", line 2421, in create
    return SMPLX(model_path, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/_/anaconda3/lib/python3.11/site-packages/smplx/body_models.py", line 993, in __init__
    super(SMPLX, self).__init__(
  File "/home/_/anaconda3/lib/python3.11/site-packages/smplx/body_models.py", line 612, in __init__
    left_hand_components = data_struct.hands_componentsl[:num_pca_comps]
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Struct' object has no attribute 'hands_componentsl'

How can I solve this problem?

Thanks in advance.