smplify-x icon indicating copy to clipboard operation
smplify-x copied to clipboard

RuntimeError: The size of tensor a (118) must match the size of tensor b (111) at non-singleton dimension 1

Open bohanfeng opened this issue 1 year ago • 6 comments

python smplifyx/main.py --config cfg_files/fit_smplx.yaml --data_folder input_image1/ --output_folder OUTPUT_FOLDER --visualize="True" --model_folder models_smplx_v1_1/ --vposer_ckpt V02_05/ --part_segm_fn smplx_parts_segm.pkl Processing: input_image1/images/2023-09-15-165143.jpg 2023-09-15 17:08:35.404 | INFO | human_body_prior.tools.model_loader:load_model:77 - No GPU detected. Loading on CPU! 2023-09-15 17:08:35.435 | INFO | human_body_prior.tools.model_loader:load_model:97 - Loaded model in eval mode with trained weights: V02_05/snapshots/V02_05_epoch=13_val_loss=0.03.ckpt /home/user/Desktop/smplify-x/smplifyx/optimizers/lbfgs_ls.py:238: UserWarning: This overload of add_ is deprecated: add_(Number alpha, Tensor other) Consider using one of the following signatures instead: add_(Tensor other, *, Number alpha) (Triggered internally at ../torch/csrc/utils/python_arg_parser.cpp:1485.) p.data.add_(step_size, update[offset:offset + numel].view_as(p.data)) Camera initialization done after 6.5344 Camera initialization final loss 1871.7843 Stage: 0%| | 0/5 [00:00<?, ?it/s] Orientation: 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "smplifyx/main.py", line 272, in main(**args) File "smplifyx/main.py", line 245, in main fit_single_frame(img, keypoints[[person_id]], File "/home/user/Desktop/smplify-x/smplifyx/fit_single_frame.py", line 440, in fit_single_frame final_loss_val = monitor.run_fitting( File "/home/user/Desktop/smplify-x/smplifyx/fitting.py", line 174, in run_fitting loss = optimizer.step(closure) File "/home/user/.local/lib/python3.8/site-packages/torch/optim/optimizer.py", line 280, in wrapper out = func(*args, **kwargs) File "/home/user/Desktop/smplify-x/smplifyx/optimizers/lbfgs_ls.py", line 280, in step orig_loss = closure() File "/home/user/Desktop/smplify-x/smplifyx/fitting.py", line 241, in fitting_func total_loss = loss(body_model_output, camera=camera, File "/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/home/user/Desktop/smplify-x/smplifyx/fitting.py", line 366, in forward weights = (joint_weights * joints_conf RuntimeError: The size of tensor a (118) must match the size of tensor b (111) at non-singleton dimension 1

I meet with this runtime error problem, I have add --face and --hand option in openpose, and use_hands: True use_face: True in fit_smplx.yaml. I wonder how to solve this problem, thanks!

bohanfeng avatar Sep 15 '23 09:09 bohanfeng