bethgelab/siamese-mask-rcnn

Cannot load data successfully

Closed this issue · 2 comments

I put train2017, val2017 and annotations under data/coco. The error info:

loading annotations into memory...
Done (t=15.71s)
creating index...
index created!
Training data is loaded !
loading annotations into memory...
Done (t=23.77s)
creating index...
index created!
Traceback (most recent call last):
File "python_train.py", line 62, in
coco_val.build_indices()
File "/person/hello/siamese-mask-rcnn-master/lib/utils.py", line 328, in build_indices
self.category_image_index = IndexedCocoDataset._build_category_image_index(self.image_category_index)
File "/person/hello/siamese-mask-rcnn-master/lib/utils.py", line 353, in _build_category_image_index
for category in range(max(image_category_index)[0]+1):
ValueError: max() arg is an empty sequence

A bug detected in train.ipynb:

Load COCO/val dataset

coco_val = siamese_utils.IndexedCocoDataset()
coco_train.load_coco(COCO_DATA, subset="train", subsubset="val", year="2017")
coco_val.prepare()
coco_val.build_indices()
coco_val.ACTIVE_CLASSES = train_classes

should be corrected to:

Load COCO/val dataset

coco_val = siamese_utils.IndexedCocoDataset()
coco_val.load_coco(COCO_DATA, subset="train", subsubset="val", year="2017")
coco_val.prepare()
coco_val.build_indices()
coco_val.ACTIVE_CLASSES = train_classes

Thanks for catching this error! Should be solved with commit 787fc3c.