Good day, I am trying to follow the Color Splash Example via this blog post where I used my own class, which detects roofs in the image. I just replaced the balloon class with roof so the configuration has only 2 classes (including the background). I annotated my own images using VIA v.2.0.5. However during training, I am getting the following error:
Epoch 1/30
ERROR:root:Error processing image {'id': '0030_0040.png', 'source': 'roof', 'path': 'roxas-mask-rcnn/val/0030_0040.png', 'width': 255, 'height': 260, 'polygons': [{'name': 'polygon', 'all_points_x': [7, 42, 90, 14, 1, 1, 19], 'all_points_y': [107, 89, 175, 213, 186, 144, 135]}, {'name': 'polygon', 'all_points_x': [185, 231, 253, 254, 220], 'all_points_y': [142, 117, 157, 183, 202]}, {'name': 'polygon', 'all_points_x': [82, 119, 135, 92], 'all_points_y': [220, 202, 226, 250]}]}
Traceback (most recent call last):
File "/home/deankarlo/anaconda3/envs/tf-gpu/lib/python3.6/site-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1709, in data_generator
use_mini_mask=config.USE_MINI_MASK)
File "/home/deankarlo/anaconda3/envs/tf-gpu/lib/python3.6/site-packages/mask_rcnn-2.1-py3.6.egg/mrcnn/model.py", line 1275, in load_image_gt
source_class_ids = dataset.source_class_ids[dataset.image_info[image_id]["source"]]
KeyError: 'roof'
Why is it looking for a key named roof? Is it supposed to look for source instead? Any help is appreciated. Thank you!
Solved. The problem is just a misnaming of the class. Specifically:
class RoofDataset(utils.Dataset):
def load_roof(self, dataset_dir, subset):
"""Load a subset of the Roof dataset.
dataset_dir: Root directory of the dataset.
subset: Subset to load: train or val
"""
# Add classes. We have only one class to add.
self.add_class("roof", 1, "roof") #this line has a mistake, class is misnamed
Thank you.
Thanks a lot cvKDean!
Most helpful comment
Solved. The problem is just a misnaming of the class. Specifically:
Thank you.