Jeff-sjtu / HybrIK

Official code of "HybrIK: A Hybrid Analytical-Neural Inverse Kinematics Solution for 3D Human Pose and Shape Estimation", CVPR 2021
MIT License
1.16k stars 142 forks source link

Keyerror for Training Model #208

Closed Dipankar1997161 closed 7 months ago

Dipankar1997161 commented 7 months ago

@biansy000,

I was training a model for my own data and I got all the necessary keys needed. however, I got the following error,

     KeyError: Caught KeyError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/ndip/miniconda3/envs/mmlab/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/ndip/miniconda3/envs/mmlab/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/ndip/miniconda3/envs/mmlab/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 51, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/ndip/HybrIK/hybrik/datasets/mix_dataset.py", line 190, in __getitem__
    img, target, img_id, bbox = self._subsets[dataset_idx][sample_idx]
  File "/home/ndip/HybrIK/hybrik/datasets/NtopSMPL.py", line 187, in __getitem__
    target = self.transformation(img, label)
  File "/home/ndip/HybrIK/hybrik/utils/presets/simple_transform_3d_smpl.py", line 310, in __call__
    joint_img_17 = label['joint_img_17'].copy()
KeyError: 'joint_img_17'

My dataset is not based on Human3.6m, it has 24 joints which is similar to smpl_joints. It is a new dataset which I have made having over a million images(planning to make it public)

is it necessary to have that key? like joint_img_17, joint_cam_17??

How can I avoid this error?? Just comment them out or what?

the error occurs in this line:

https://github.com/Jeff-sjtu/HybrIK/blob/9b8681dcf3c902dd5dacc01520ba04982990e1e2/hybrik/utils/presets/simple_transform_3d_smpl.py#L310

Appreciate your response on this

Dipankar1997161 commented 7 months ago

solved