mmdetection: MaskRCNN - IndexError: list index out of range after training 1 epoch

Hello, I’m having trouble with this kinda weird error:

  File "./mmdetection/mmdet/datasets/coco.py", line 259, in _segm2json
    if isinstance(segms[i]['counts'], bytes):
IndexError: list index out of range

Showing up right after I trained 1 epoch 😢

Could anyone help me to handle it 💌 Thanks in advance!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 15

Most upvoted comments

+1

Are you using the coco data set? Can you provide more details?

I use the custom dataset but covert it to coco format, the error appear when evaluation:

2021-04-28 14:33:52,806 - mmdet - INFO - Saving checkpoint at 1 epochs [>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 50/50, 6.9 task/s, elapsed: 7s, ETA: 0sTraceback (most recent call last): File “tools/train.py”, line 190, in <module> main() File “tools/train.py”, line 186, in main meta=meta) File “/home/chenyixin03/mmdetection/mmdet/apis/train.py”, line 171, in train_detector runner.run(data_loaders, cfg.workflow) File “/home/chenyixin03/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py”, line 125, in run epoch_runner(data_loaders[i], **kwargs) File “/home/chenyixin03/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py”, line 54, in train self.call_hook(‘after_train_epoch’) File “/home/chenyixin03/miniconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/base_runner.py”, line 307, in call_hook getattr(hook, fn_name)(self) File “/home/chenyixin03/mmdetection/mmdet/core/evaluation/eval_hooks.py”, line 147, in after_train_epoch key_score = self.evaluate(runner, results) File “/home/chenyixin03/mmdetection/mmdet/core/evaluation/eval_hooks.py”, line 177, in evaluate results, logger=runner.logger, **self.eval_kwargs) File “/home/chenyixin03/mmdetection/mmdet/datasets/coco.py”, line 417, in evaluate result_files, tmp_dir = self.format_results(results, jsonfile_prefix) File “/home/chenyixin03/mmdetection/mmdet/datasets/coco.py”, line 362, in format_results result_files = self.results2json(results, jsonfile_prefix) File “/home/chenyixin03/mmdetection/mmdet/datasets/coco.py”, line 299, in results2json json_results = self._segm2json(results) File “/home/chenyixin03/mmdetection/mmdet/datasets/coco.py”, line 267, in _segm2json if isinstance(segms[i][‘counts’], bytes): IndexError: list index out of range

You can also use visual scripts to find problems easily

Sir, thanks for your reply. I did check the data(only 1 class) but everything seems good 😕

I suspect that your data may be incorrectly labeled, you need to check