question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

during training got an error

See original GitHub issue

when 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12

github_iconTop GitHub Comments

1reaction
paulinemlcommented, Nov 9, 2020
0reactions
NEUdeepcommented, Jun 12, 2021

我这里添加一个新的情况: 我遇到这个问题也是在跑mask系列的swin算法,也尝试了这里的各种说法,但是,最后发现是一个很愚蠢的问题,就是mask系列默认是分割的,而很多人一开始搞不清coco_instance.py和detection配置的区别,而我的数据本身只标定了box,segmentation是null,所以本身数据,或者配置的classes数目都没问题,问题在数据的格式上。

Read more comments on GitHub >

github_iconTop Results From Across the Web

The benefits of errors during training - ScienceDirect.com
Errors used as a learning tool can improve understanding and casework performance. •. Errors should be promoted in training to challenge examiners in...
Read more >
Learning From Mistakes: Error Management in Training
This process helps learners both to understand concepts better and to learn strategies to quickly recover from inevitable future errors.
Read more >
Error during training phase - MATLAB Answers - MathWorks
This code, with a different computer, runs with no errors. Can someone help me understand what may be the cause? can anyone help...
Read more >
Making the best of errors during training - ResearchGate
For instance, according to error-management training theory, errors should be framed as positive events to improve reflection, feedback, and ...
Read more >
Batch size of 1 raises shape error during training. #335 - GitHub
A batch size of 1 raises a shape error during training. ... Expected more than 1 value per channel when training, got input...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found