mmrotate eval_map.py IndexError: tuple index out of range

140 Views Asked by At

When I trained the /mmrotate/configs/rotated_retinanet/rotated_retinanet_obb_r50_fpn_6x_hrsc_rr_le90.py with fine_grained, I got IndexError: tuple index out of range. After trained this baseline without evaluation(--no-validate), it can execute successfully.
This is the link to the baseline from GitHub.(https://github.com/open-mmlab/mmrotate/blob/main/configs/rotated_retinanet/rotated_retinanet_obb_r50_fpn_6x_hrsc_rr_le90.py) The following is the traceback. Could you tell me how to solve it? I just want to evaluate the result of baseline with fine_grained on HRSC2016 dataset. Thank you very much.

Traceback (most recent call last):
  File "tools/train.py", line 192, in <module>
    main()
  File "tools/train.py", line 181, in main
    train_detector(
  File "/root/autodl-tmp/mmrotate/mmrotate/apis/train.py", line 141, in train_detector
    runner.run(data_loaders, cfg.workflow)
  File "/root/miniconda3/envs/mmrotate/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 136, in run
    epoch_runner(data_loaders[i], **kwargs)
  File "/root/miniconda3/envs/mmrotate/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 58, in train
    self.call_hook('after_train_epoch')
  File "/root/miniconda3/envs/mmrotate/lib/python3.8/site-packages/mmcv/runner/base_runner.py", line 317, in call_hook
    getattr(hook, fn_name)(self)
  File "/root/miniconda3/envs/mmrotate/lib/python3.8/site-packages/mmcv/runner/hooks/evaluation.py", line 271, in after_train_epoch
    self._do_evaluate(runner)
  File "/root/miniconda3/envs/mmrotate/lib/python3.8/site-packages/mmdet/core/evaluation/eval_hooks.py", line 63, in _do_evaluate
    key_score = self.evaluate(runner, results)
  File "/root/miniconda3/envs/mmrotate/lib/python3.8/site-packages/mmcv/runner/hooks/evaluation.py", line 367, in evaluate
    eval_res = self.dataloader.dataset.evaluate(
  File "/root/autodl-tmp/mmrotate/mmrotate/datasets/hrsc.py", line 251, in evaluate
    mean_ap, _ = eval_rbbox_map(
  File "/root/autodl-tmp/mmrotate/mmrotate/core/evaluation/eval_map.py", line 243, in eval_rbbox_map
    print_map_summary(
  File "/root/autodl-tmp/mmrotate/mmrotate/core/evaluation/eval_map.py", line 305, in print_map_summary
    label_names[j], num_gts[i, j], results[j]['num_dets'],
IndexError: tuple index out of range

By the way, I checked the num_classes=33 and the classwise=True.

To evaluate the https://github.com/open-mmlab/mmrotate/blob/main/configs/rotated_retinanet/rotated_retinanet_obb_r50_fpn_6x_hrsc_rr_le90.py with fine_grained on HRSC2016 dataset.

1

There are 1 best solutions below

0
On

In configs/datasets/hrsc.py, set

classwise = True

which solved my problem