matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.7k stars 11.71k forks source link

TypeError: 'NoneType' object is not subscriptable #2550

Closed AmeyaK17 closed 3 years ago

AmeyaK17 commented 3 years ago

Getting this error while training my Mask RCNN model. I ran this command: !python optic_disc.py train --dataset=dataset/ --weights=coco

Traceback (most recent call last): File "optic_disc.py", line 364, in train(model) File "optic_disc.py", line 183, in train dataset_train.load_optic_disc(args.dataset, "train") File "optic_disc.py", line 128, in load_optic_disc polygons = [r['shape_attributes'] for r in a['regions']] File "optic_disc.py", line 128, in polygons = [r['shape_attributes'] for r in a['regions']] TypeError: 'NoneType' object is not subscriptable

I tried searching the net, but I am unable to find a solution. Can you help me with this?

AmeyaK17 commented 3 years ago

Solved ✅ Seems this error is caused by ShapeError. There was some mistake while labelling my dataset. After rectifying the mistake and passing the correct labelled dataset, the model started training as usual.