vchoutas / smplx

SMPL-X
https://smpl-x.is.tue.mpg.de/
Other
1.78k stars 303 forks source link

SMPL to SMPLX error #118

Closed Alex-web100 closed 2 years ago

Alex-web100 commented 2 years ago

Hello, when trying to run the SMPL to SMPLX transfer, I encounter the following error

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/sashawald/Documents/smplx/transfer_model/__main__.py", line 100, in <module>
    main()
  File "/home/sashawald/Documents/smplx/transfer_model/__main__.py", line 54, in main
    body_model = build_layer(model_path, **exp_cfg.body_model)
  File "/home/sashawald/Documents/smplx/smplx/body_models.py", line 2345, in build_layer
    raise ValueError(f'Unknown model type {model_type}, exiting!')
ValueError: Unknown model type body, exiting!

Does anyone know what might be causing this issue? I am trying to convert a folder of .ply files. Thank you!

hshreeshail commented 2 years ago

I am getting the same error. How did you solve it @Alex-web100 ?

Alex-web100 commented 2 years ago

Hello! I don't have very detailed notes on how I fixed it, but I did write down that it ended up being an issue with the way the files on my machine were structured. I would recommend checking that your folder structure looks similar to the one outlined here, and also to ensure that you have the correct file path entered in the config file – for me it needed to be adjusted.

hshreeshail commented 2 years ago

I see. I solved this problem by commenting out the following lines from the build_layer() function in smplx/body_models.py:

else:
    model_type = osp.basename(model_path).split('_')[0].lower()

because it was incorrectly changing the value of variable model_type to 'body', whereas the original value of model_type passed to the build_layer() function was correctly set (to either of 'smpl/smplh/smplx')

hshreeshail commented 2 years ago

@Alex-web100 Thanks for the prompt reply. The stuff you mentioned about the setting the directory structure right: I found it useful to resolve the following error that I encountered: ImportError: attempted relative import with no known parent package

Alex-web100 commented 2 years ago

I see! Glad I could be helpful :)

leejielong commented 1 year ago

Hi, just wanted to provide the correct solution to this issue. This error happens if we do not create the body_models folder under transfer_data. So the solution is to simply create the transfer_data/body_models folder.