loading annotations into memory...
Done (t=0.17s)
creating index...
index created!
2019-04-29 18:33:58,770 maskrcnn_benchmark.trainer INFO: Start training
Traceback (most recent call last):
File "tools/train_net.py", line 199, in
main()
File "tools/train_net.py", line 192, in main
model = train(cfg, args.local_rank, args.distributed)
File "tools/train_net.py", line 93, in train
arguments,
File "/home/ubuntu/ccf-traffic-sign-identification/maskrcnn-benchmark/maskrcnn_benchmark/engine/trainer.py", line 57, in do_train
for iteration, (images, targets, _) in enumerate(data_loader, start_iter):
File "/opt/anaconda3/envs/maskrcnn_benchmark/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 551, in __next__
return self._process_next_batch(batch)
File "/opt/anaconda3/envs/maskrcnn_benchmark/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 577, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/opt/anaconda3/envs/maskrcnn_benchmark/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/opt/anaconda3/envs/maskrcnn_benchmark/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/ubuntu/ccf-traffic-sign-identification/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/coco.py", line 83, in __getitem__
masks = SegmentationMask(masks, img.size, mode='poly')
File "/home/ubuntu/ccf-traffic-sign-identification/maskrcnn-benchmark/maskrcnn_benchmark/structures/segmentation_mask.py", line 467, in __init__
self.instances = PolygonList(instances, size)
File "/home/ubuntu/ccf-traffic-sign-identification/maskrcnn-benchmark/maskrcnn_benchmark/structures/segmentation_mask.py", line 344, in __init__
assert isinstance(polygons[0][0], (list, tuple)), str(
IndexError: list index out of range
Hello, I have the same problem with you, after reinstalling maskrcnn-benchmark。
I guess you are not using the original coco annotation, right?
Can we you check if all your polygons annotations are valid?
i.e. are all inside the image and the minimal length is greater than 6?
I also meet the same problem, have you ever solved the problem?
I also have this problem, and all my segmentation annotations are [[]] because I only want to do detection and I used faster-rcnn.yaml, I thought it would not use segmentation annotations but it seemed to be wrong.
My work around is to comment these 3 lines of function __getitem__ in maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/coco.py
masks = [obj["segmentation"] for obj in anno]
masks = SegmentationMask(masks, img.size, mode='poly')
target.add_field("masks", masks)
Same issue here any workaround
/maskrcnn-benchmark/maskrcnn_benchmark/structures/segmentation_mask.py", line 376, in __init__
type(polygons[0][0])
AssertionError:
Most helpful comment
My work around is to comment these 3 lines of function
__getitem__in maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/coco.pymasks = [obj["segmentation"] for obj in anno]masks = SegmentationMask(masks, img.size, mode='poly')target.add_field("masks", masks)