open-mmlab / mmhuman3d

OpenMMLab 3D Human Parametric Model Toolbox and Benchmark
https://mmhuman3d.readthedocs.io/
Apache License 2.0
1.25k stars 137 forks source link

error when caculate PA-PVE of expose #308

Closed lonelypicker closed 1 year ago

lonelypicker commented 1 year ago

We train expose with resnet18_hmr_expose_hand.py, and get error when evaluate PA-PVE. 2023-02-10 11:31:24,855 - mmhuman3d - INFO - Saving checkpoint at 10 epochs [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 26048/26048, 155.4 task/s, elapsed: 168s, ETA: 0sTraceback (most recent call last): File "tools/train.py", line 155, in main() File "tools/train.py", line 143, in main train_model( File "/usr/local/miniconda3/lib/python3.8/site-packages/mmhuman3d-0.9.0-py3.8.egg/mmhuman3d/apis/train.py", line 164, in train_model runner.run(data_loaders, cfg.workflow) File "/usr/local/miniconda3/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 130, in run epoch_runner(data_loaders[i], kwargs) File "/usr/local/miniconda3/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 56, in train self.call_hook('after_train_epoch') File "/usr/local/miniconda3/lib/python3.8/site-packages/mmcv/runner/base_runner.py", line 309, in call_hook getattr(hook, fn_name)(self) File "/usr/local/miniconda3/lib/python3.8/site-packages/mmcv/runner/hooks/evaluation.py", line 267, in after_train_epoch self._do_evaluate(runner) File "/usr/local/miniconda3/lib/python3.8/site-packages/mmcv/runner/hooks/evaluation.py", line 273, in _do_evaluate key_score = self.evaluate(runner, results) File "/usr/local/miniconda3/lib/python3.8/site-packages/mmhuman3d-0.9.0-py3.8.egg/mmhuman3d/core/evaluation/eval_hooks.py", line 56, in evaluate eval_res = self.dataloader.dataset.evaluate( File "/usr/local/miniconda3/lib/python3.8/site-packages/mmhuman3d-0.9.0-py3.8.egg/mmhuman3d/data/datasets/human_image_smplx_dataset.py", line 377, in evaluate _nv_tuples = self._report_pve(res, metric='pa-pve') File "/usr/local/miniconda3/lib/python3.8/site-packages/mmhuman3d-0.9.0-py3.8.egg/mmhuman3d/data/datasets/human_image_dataset.py", line 552, in _report_pve self._parse_result(res_file, mode='vertice', body_part=body_part) File "/usr/local/miniconda3/lib/python3.8/site-packages/mmhuman3d-0.9.0-py3.8.egg/mmhuman3d/data/datasets/human_image_smplx_dataset.py", line 142, in _parse_result gt_output = self.body_model(gt_param_dict) File "/usr/local/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/usr/local/miniconda3/lib/python3.8/site-packages/mmhuman3d-0.9.0-py3.8.egg/mmhuman3d/models/body_models/mano.py", line 225, in forward mano_output = super(MANOLayer, self).forward(args, **kwargs) File "/usr/local/miniconda3/lib/python3.8/site-packages/smplx/body_models.py", line 1742, in forward full_pose = torch.cat([global_orient, hand_pose], dim=1) RuntimeError: Tensors must have same number of dimensions: got 3 and 4 It seems that PA-PVE caculation for SMPLXImageBodyModelEstimator is not surported yet. When I add following two lines in human_image_smplx_dataset.py in _parse_result, PA-PVE can be caculated. But with pretrained model you provide, we test resnet18_hmr_expose_hand.py, and get PA-PVE=21.66 which is much larger than your test, while pa-MPJPE=10.03 which is the same with your test. So, how to calculate PA-PVE in your test? if key == 'global_orient': new_value = new_value.unsqueeze(1)