I train my own data set,change the RPN_RATIOS in config.py,my ratios has more than three elements,when I run the following code
`model = modellib.MaskRCNN(mode='training', config=config, model_dir=ROOT_DIR)
model.load_weights(COCO_MODEL_PATH, by_name=True, exclude=[
"mrcnn_class_logits", "mrcnn_bbox_fc",
"mrcnn_bbox", "mrcnn_mask"])
the error as follows:
ValueError: Layer #359 (named "rpn_model"), weight
does the coco preptrained weigths not match the new anchors in Layers(such as P2,P3,P3...)
I also remove the cache maded by training previous
@Emma-uestc Do not load RPN weights when you load pre-train model, you can modify training code like this:
model.load_weights(
weights_path,
by_name=True,
exclude=[
"mrcnn_class_logits", "mrcnn_bbox_fc", "mrcnn_bbox", "mrcnn_mask",
"rpn_model" # because anchor's ratio has been changed
])
Most helpful comment
@Emma-uestc Do not load RPN weights when you load pre-train model, you can modify training code like this: