Mask_RCNN
Mask_RCNN copied to clipboard
ValueError: Layer #389 (named "mrcnn_bbox_fc"), weight <tf.Variable 'mrcnn_bbox_fc/kernel:0' shape=(1024, 40) dtype=float32> has shape (1024, 40), but the saved weight has shape (1024, 324)
I had this problem in google colab tensorflow==2.4.1 kera==2.4.3
if init_with == "imagenet": model.load_weights(model.get_imagenet_weights(), by_name=True) elif init_with == "coco":
Load weights trained on MS COCO, but skip layers that
are different due to the different number of classes
See README for instructions to download the COCO weights
model.load_weights(COCO_MODEL_PATH, by_name=True, exclude=["mrcnn_class_logits", "mrcnn_bbox_fc", "mrcnn_bbox", "mrcnn_mask"]) elif init_with == "last":
Load the last model you trained and continue training
model.load_weights(model.find_last(), by_name=True)
mistake:
ValueError Traceback (most recent call last)
786 symbolic_weights[i])) +
787 ', but the saved weight has shape ' +
--> 788 str(weight_values[i].shape) + '.') 789 790 else:
ValueError: Layer #389 (named "mrcnn_bbox_fc"), weight <tf.Variable 'mrcnn_bbox_fc/kernel:0' shape=(1024, 40) dtype=float32> has shape (1024, 40), but the saved weight has shape (1024, 324).
Please anybody can help me.