muelea/smplify-xmc

Run demo, but report an error

Closed this issue · 3 comments

Thanks for your great works!
When I tried to run your demo, it reported the following error:
RuntimeError: einsum() operands do not broadcast with remapped shapes [original->remapped]: [1, 20]->[1, 1, 1, 20] [10475, 3, 400]->[1, 10475, 3, 400]
Can you help me see what's wrong? Thank you very much!

I will try to reproduce your error, but I need more information for it. Can you please tell me which demo you mean, from where did you download the body model, and from which file this error is raised?

I will try to reproduce your error, but I need more information for it. Can you please tell me which demo you mean, from where did you download the body model, and from which file this error is raised?

I download the model from this website:
The specific download is the model under the title of smpl-x model (Download SMPL-X v1.1 (830 MB))
Then I create a new model folder in the root directory of this project and put the downloaded smpl-x model in it. The file structure is as follows:

  • configs
  • data
  • lib
  • model
    • smplx
      • SMPLX_FEMALE.npz
      • SMPLX_MALE.npz
      • SMPLX_NEUTRAL.npz
      • SMPLX_FEMALE.pkl
      • SMPLX_MALE.pkl
      • SMPLX_NEUTRAL.pkl

Finally, I set the path of the model file in the configuration file (configs/fit_smplx_singleview.yaml)
model_folder: model or
mdel_folder: model/smplx/SMPLX_MEUTRAL.npz

python main_singleview.py --config configs/fit_smplx_singleview.yaml \
--dataset mtp_demo \
--input_base_dir data/example_input/singleview/subject1 \
--input_dir_poses data/example_input/presented_poses \
--output_dir data/example_output/singleview/subject1 \
--model_folder model/smplx/SMPLX_NEUTRAL.npz

I set these two paths, but both reported the same error.I need your help. Thank you very much!

woo1 commented

Same error, too.
I updated "model_folder" in "fit_smplx_singleview.yaml" to "models" folder path in smpl-x.

python main_singleview.py --config configs/fit_smplx_singleview.yaml \ --dataset mtp_demo \ --input_base_dir data/example_input/singleview/subject1 \ --input_dir_poses data/example_input/presented_poses \ --output_dir data/example_output/singleview/subject1

Traceback (most recent call last):
File "main_singleview.py", line 243, in
main(**args)
File "main_singleview.py", line 233, in main
**args)
File "/smplify-xmc/lib/core/fit_single_frame.py", line 167, in fit_single_frame
global_orientation_stratey=go_sel_strategy)
File "/smplify-xmc/lib/utils/estimate_global_orient.py", line 74, in best_fit_presented_global_orientation
body = body_model()
File "/smplify-xmc/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/smplify-xmc/venv/lib/python3.7/site-packages/smplx/body_models.py", line 924, in forward
dtype=self.dtype)
File "/smplify-xmc/venv/lib/python3.7/site-packages/smplx/lbs.py", line 179, in lbs
v_shaped = v_template + blend_shapes(betas, shapedirs)
File "/smplify-xmc/venv/lib/python3.7/site-packages/smplx/lbs.py", line 265, in blend_shapes
blend_shape = torch.einsum('bl,mkl->bmk', [betas, shape_disps])
File "/smplify-xmc/venv/lib/python3.7/site-packages/torch/functional.py", line 406, in einsum
return einsum(equation, *_operands)
File "/smplify-xmc/venv/lib/python3.7/site-packages/torch/functional.py", line 408, in einsum
return _VF.einsum(equation, operands) # type: ignore
RuntimeError: einsum() operands do not broadcast with remapped shapes [original->remapped]: [1, 20]->[1, 1, 1, 20] [10475, 3, 400]->[1, 10475, 3, 400]

environment : PyTorch 1.8.1, CUDA 10.2