Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range #10

Open
ccdongxu opened this issue Dec 13, 2022 · 5 comments
Open

IndexError: list index out of range #10

ccdongxu opened this issue Dec 13, 2022 · 5 comments

Comments

@ccdongxu
Copy link

I ran into this problem when training with a custom data set.How to solve it?
Traceback (most recent call last):
File "tools/train.py", line 191, in
main()
File "tools/train.py", line 187, in main
meta=meta)
File "/content/drive/MyDrive/boxlevelset/mmdet/apis/train.py", line 172, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/usr/local/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run
epoch_runner(data_loaders[i], **kwargs)
File "/usr/local/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 54, in train
self.call_hook('after_train_epoch')
File "/usr/local/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 307, in call_hook
getattr(hook, fn_name)(self)
File "/content/drive/MyDrive/boxlevelset/mmdet/core/evaluation/eval_hooks.py", line 147, in after_train_epoch
key_score = self.evaluate(runner, results)
File "/content/drive/MyDrive/boxlevelset/mmdet/core/evaluation/eval_hooks.py", line 177, in evaluate
results, logger=runner.logger, **self.eval_kwargs)
File "/content/drive/MyDrive/boxlevelset/mmdet/datasets/dcm.py", line 482, in evaluate
cocoEval.evaluate()
File "/usr/local/lib/python3.7/site-packages/pycocotools/cocoeval.py", line 149, in evaluate
self._prepare()
File "/usr/local/lib/python3.7/site-packages/pycocotools/cocoeval.py", line 110, in _prepare
_toMask(gts, self.cocoGt)
File "/usr/local/lib/python3.7/site-packages/pycocotools/cocoeval.py", line 95, in _toMask
rle = coco.annToRLE(ann)
File "/usr/local/lib/python3.7/site-packages/pycocotools/coco.py", line 497, in annToRLE
rles = maskUtils.frPyObjects(segm, h, w)
File "pycocotools/_mask.pyx", line 292, in pycocotools._mask.frPyObjects
IndexError: list index out of range

@LiWentomng
Copy link
Owner

@ccdongxu Hello, the annotaion json file needs the coco format.
I upload the coco-style json file (Google driver) of VOC, you can refer to it.

@ccdongxu
Copy link
Author

@LiWentomng Thank you for your answer.The coco-style json file contains segmentation fields and bbox fields. Does this mean that both segmentation annotation and target box annotation are required in my json?

@LiWentomng
Copy link
Owner

@ccdongxu The training process only needs the bbox fields in the train.json file. The val/test process need both segmentation
and box fields to evaluate the segmentatio performance (or bbox annotaion for detection performance, opitional.)

@TaoshuaiZ
Copy link

Do you mean that my val.json file must include segmentation fields?

@TaoshuaiZ
Copy link

But my dataset is marked by myself, labeled with labelme, and then converted to coco format. There are only four numbers in the segmentation, but the segmentation in the dataset used by the author has many numbers. How to solve this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants