after dealing with the compatability issues with Mask RCNN I am working now on training the model on my custom classes with the annotations json being in Coco-style.
class modelConfig(Config):
NAME = "my_coco"
NUM_CLASSES = 1 + 6
STEPS_PER_EPOCH = 100
config = modelConfig()
config.display()
model = MaskRCNN(mode='training', model_dir=DEFAULT_LOGS_DIR, config=config)
# load weights (mscoco) and exclude the output layers
model.load_weights(COCO_WEIGHTS_PATH, by_name=True, exclude=["mrcnn_class_logits", "mrcnn_bbox_fc", "mrcnn_bbox", "mrcnn_mask"])
# train weights (output layers or 'heads')
model.train(dataset_train, dataset_train, learning_rate=config.LEARNING_RATE, epochs=25, layers='heads')
The problem is that the execution is stuck on epoch 1/N
without really starting (even if reducing training dataset to 1 image).
This thread suggests that the problem can be resolved with a custom Layer --> but currently I did not manage to reproduce to resolve the problem.
But My question is do I really need the coco weights if I have custom classes? and should I (how?) initiated weights for these classes? (and of course a viable solution for the problem would be appreciated)