during training got an error
See original GitHub issuewhen i run python tools/train.py configs/mask_rcnn_r50_fpn_1x.py for instance segmentation with step followed properly for coco datasets.
but i am getting index out of range error , can anyone help why
`
2019-09-28 05:39:13,330 - INFO - Distributed training: False 2019-09-28 05:39:13,871 - INFO - load model from: torchvision://resnet50 2019-09-28 05:39:14,127 - WARNING - The model and loaded state dict do not match exactly
unexpected key in source state_dict: fc.weight, fc.bias
loading annotations into memory… Done (t=0.00s) creating index… index created! 2019-09-28 05:39:16,807 - INFO - Start running, host: root@60236732d75f, work_dir: /content/mmdetection/work_dirs/mask_rcnn_r50_fpn_1x 2019-09-28 05:39:16,807 - INFO - workflow: [(‘train’, 1)], max: 12 epochs Traceback (most recent call last): File “tools/train.py”, line 108, in <module> main() File “tools/train.py”, line 104, in main logger=logger) File “/usr/local/lib/python3.6/dist-packages/mmdet-1.0rc0+3dc9ddb-py3.6-linux-x86_64.egg/mmdet/apis/train.py”, line 60, in train_detector _non_dist_train(model, dataset, cfg, validate=validate) File “/usr/local/lib/python3.6/dist-packages/mmdet-1.0rc0+3dc9ddb-py3.6-linux-x86_64.egg/mmdet/apis/train.py”, line 221, in _non_dist_train runner.run(data_loaders, cfg.workflow, cfg.total_epochs) File “/usr/local/lib/python3.6/dist-packages/mmcv/runner/runner.py”, line 358, in run epoch_runner(data_loaders[i], **kwargs) File “/usr/local/lib/python3.6/dist-packages/mmcv/runner/runner.py”, line 260, in train for i, data_batch in enumerate(data_loader): File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py”, line 582, in next return self._process_next_batch(batch) File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py”, line 608, in _process_next_batch raise batch.exc_type(batch.exc_msg) IndexError: Traceback (most recent call last): File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py”, line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File “/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py”, line 99, in <listcomp> samples = collate_fn([dataset[i] for i in batch_indices]) File “/usr/local/lib/python3.6/dist-packages/mmdet-1.0rc0+3dc9ddb-py3.6-linux-x86_64.egg/mmdet/datasets/custom.py”, line 128, in getitem data = self.prepare_train_img(idx) File “/usr/local/lib/python3.6/dist-packages/mmdet-1.0rc0+3dc9ddb-py3.6-linux-x86_64.egg/mmdet/datasets/custom.py”, line 141, in prepare_train_img return self.pipeline(results) File “/usr/local/lib/python3.6/dist-packages/mmdet-1.0rc0+3dc9ddb-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/compose.py”, line 24, in call data = t(data) File “/usr/local/lib/python3.6/dist-packages/mmdet-1.0rc0+3dc9ddb-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/loading.py”, line 107, in call results = self._load_masks(results) File “/usr/local/lib/python3.6/dist-packages/mmdet-1.0rc0+3dc9ddb-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/loading.py”, line 88, in _load_masks gt_masks = [self._poly2mask(mask, h, w) for mask in gt_masks] File “/usr/local/lib/python3.6/dist-packages/mmdet-1.0rc0+3dc9ddb-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/loading.py”, line 88, in <listcomp> gt_masks = [self._poly2mask(mask, h, w) for mask in gt_masks] File “/usr/local/lib/python3.6/dist-packages/mmdet-1.0rc0+3dc9ddb-py3.6-linux-x86_64.egg/mmdet/datasets/pipelines/loading.py”, line 73, in _poly2mask rles = maskUtils.frPyObjects(mask_ann, img_h, img_w) File “pycocotools/_mask.pyx”, line 292, in pycocotools._mask.frPyObjects IndexError: list index out of range
`
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12
Top GitHub Comments
Same error here, https://github.com/open-mmlab/mmdetection/issues/3338 fixed it.
我这里添加一个新的情况: 我遇到这个问题也是在跑mask系列的swin算法,也尝试了这里的各种说法,但是,最后发现是一个很愚蠢的问题,就是mask系列默认是分割的,而很多人一开始搞不清coco_instance.py和detection配置的区别,而我的数据本身只标定了box,segmentation是null,所以本身数据,或者配置的classes数目都没问题,问题在数据的格式上。