bethgelab/siamese-mask-rcnn

The problem meet when i try to run the train.ipynb

Closed this issue · 4 comments

Running the Dataset section

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

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

it says i lack "active_classes

loading annotations into memory...
Done (t=16.04s)
creating index...
index created!


AttributeError Traceback (most recent call last)
in ()
2 coco_train = siamese_utils.IndexedCocoDataset()
3 # coco_train.set_active_classes(train_classes)
----> 4 coco_train.load_coco(COCO_DATA, "train", year="2017")
5 coco_train.prepare()
6 coco_train.build_indices()

/mnt/Disk1/liangzh/siamese-mask-rcnn/lib/Mask_RCNN/samples/coco/coco.py in load_coco(self, dataset_dir, subset, year, class_ids, class_map, return_coco, auto_download, subsubset)
118 # # All classes
119 # class_ids = sorted(coco.getCatIds())
--> 120 if len(self.active_classes) == 0:
121 # All classes
122 class_ids = sorted(coco.getCatIds())

AttributeError: 'IndexedCocoDataset' object has no attribute 'active_classes'

thank you!

I have solved this problem by replacing the Mask_RCNN with the original repository, author change the coco.py so that lack the 'active_classes'

To understand this correct: It worked with our version of Mask_RCNN and the corresponding version of coco.py but not with the current version of the Mask_RCNN code from https://github.com/matterport/Mask_RCNN ?

I found the bug. We apparently made some changes in the Mask R-CNN code. Specifically we added self.active classes = [] to the init of the Dataset class in lib/Mask_RCNN/mrcnn/utils.py and reference it in the samples lib/Mask_RCNN/samples/coco/coco.py. This is definitely unintuitive and prevents updating the Mask R-CNN code.

This should be fixed with commit 5d92638. Please report if the error should still exist.