SamsungLabs / tr3d

[ICIP2023] TR3D: Towards Real-Time Indoor 3D Object Detection
Other
141 stars 8 forks source link

KeyError occurs when loading sunrgbd data set #32

Closed 1789083523 closed 3 months ago

1789083523 commented 3 months ago

Hello, I am a newbie who has just come into contact with indoor object detection, and now I have encountered a problem. When I run the command python tools/train.py configs/tr3d/tr3d-ff_sunrgbd-3d-10class.py, a KeyError occurs. Below is the error log information. Traceback (most recent call last): File "tools/train.py", line 263, in <module> main() File "tools/train.py", line 252, in main train_model( File "/root/tr3d-main/mmdet3d/apis/train.py", line 344, in train_model train_detector( File "/root/tr3d-main/mmdet3d/apis/train.py", line 319, in train_detector runner.run(data_loaders, cfg.workflow) File "/root/miniconda3/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 136, in run epoch_runner(data_loaders[i], **kwargs) File "/root/miniconda3/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 49, in train for i, data_batch in enumerate(self.data_loader): File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in __next__ data = self._next_data() File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data return self._process_data(data) File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data data.reraise() File "/root/miniconda3/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise raise exception KeyError: Caught KeyError in DataLoader worker process 0. Original Traceback (most recent call last): File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop data = fetcher.fetch(index) File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/miniconda3/lib/python3.8/site-packages/mmdet/datasets/dataset_wrappers.py", line 178, in __getitem__ return self.dataset[idx % self._ori_len] File "/root/tr3d-main/mmdet3d/datasets/custom_3d.py", line 435, in __getitem__ data = self.prepare_train_data(idx) File "/root/tr3d-main/mmdet3d/datasets/custom_3d.py", line 225, in prepare_train_data input_dict = self.get_data_info(index) File "/root/tr3d-main/mmdet3d/datasets/sunrgbd_dataset.py", line 94, in get_data_info info = self.data_infos[index] KeyError: 0

Please tell me what is the cause of this problem? Is there something wrong with the sunrgbd_infos_train.pkl file?

filaPro commented 3 months ago

I think so. Have you preprocessed sun rgb-d with our repo and not with original mmdetection3d?

1789083523 commented 3 months ago

I think so. Have you preprocessed sun rgb-d with our repo and not with original mmdetection3d?

Thank you very much for your reminder. I have resolved the issue! The problem was due to my old version of the code for processing the Sun RGB-D dataset. After reprocessing with the new version, everything worked fine. Thanks again!