r3det-on-mmdetection icon indicating copy to clipboard operation
r3det-on-mmdetection copied to clipboard

IndexError: list index out of range

Open why228430 opened this issue 4 years ago • 7 comments

when I run "sh rtools/train.sh",I meet the error. How I can do to solve the problem? 2020-10-17 10:25:11,392 - mmdet - INFO - Saving checkpoint at 1 epochs completed: 0, elapsed: 0sTraceback (most recent call last): File "tools/train.py", line 161, in main() File "tools/train.py", line 157, in main meta=meta) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/apis/train.py", line 179, in train_detector runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 122, in run epoch_runner(data_loaders[i], **kwargs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 46, in train self.call_hook('after_train_epoch') File "/home/dl/anaconda3/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 282, in call_hook getattr(hook, fn_name)(self) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/core/evaluation/eval_hooks.py", line 28, in after_train_epoch self.evaluate(runner, results) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/core/evaluation/eval_hooks.py", line 32, in evaluate results, logger=runner.logger, **self.eval_kwargs) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/datasets/dotav1.py", line 187, in evaluate logger=logger) File "/home/dl/anaconda3/lib/python3.7/site-packages/mmdet-2.1.0+8f3868f-py3.7-linux-x86_64.egg/mmdet/core/evaluation/rmean_ap.py", line 196, in reval_map num_classes = len(det_results[0]) # positive class num IndexError: list index out of range

why228430 avatar Oct 17 '20 07:10 why228430

Have you solved this problem?

houliping avatar Nov 02 '20 06:11 houliping

Hi,@why228430 I also encountered this problem. Have you solved your problem?

seacloud-0420 avatar Jan 19 '21 08:01 seacloud-0420

I also encountered this problem. And I have checked the class num repeatedly. Have you solved your problem?

PuyangChen avatar Mar 25 '21 08:03 PuyangChen

same problem, i met this when just finishing the first epoch

tjmannn avatar Mar 30 '21 05:03 tjmannn

same problem, i met this when just finishing the first epoch

I met the same problem before. Now, I have already fixed it.

Error: num_classes = len(det_results[0]) # positive class num

My problem is due to the det_results is an empty list, because the test.txt is empty. After training the first epoch, there are no data to validate. So it returns the error: list index out of range. I hope it could help those who encounter the same problem.

PuyangChen avatar Mar 30 '21 06:03 PuyangChen

In my ieda,it's maybe the error of dataset

colorfully-ybf avatar Jan 09 '22 01:01 colorfully-ybf

same problem, i met this when just finishing the first epoch

I met the same problem before. Now, I have already fixed it.

Error: num_classes = len(det_results[0]) # positive class num

My problem is due to the det_results is an empty list, because the test.txt is empty. After training the first epoch, there are no data to validate. So it returns the error: list index out of range. I hope it could help those who encounter the same problem.

Sorry, I don't quite understand this error. If I want to fix this error, do I need to add the relevant files?

HeHuasu avatar Jun 18 '23 06:06 HeHuasu