Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
HwangGB opened this issue Jun 12, 2024 · 0 comments

Comments

@HwangGB
Copy link

HwangGB commented Jun 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant