1、当我们使用mask rcnn训练自己的数据集的时候 ,可能适当的改变网络框架,此时迁移学习的时候 权重就发生了改变这个时候
我们改两个地方,比如 这个模块,此时在加载数据的时候 就会出现权重不匹配的情况,这个时候需要在载入权重的时候,去除这部分就OK
def build_rpn_model(anchor_stride, anchors_per_location, depth):
"""Builds a Keras model of the Region Proposal Network.
It wraps the RPN graph so it can be used multiple times with shared
weights.
anchors_per_location: number of anchors per pixel in the feature map
anchor_stride: Controls the density of anchors. Typically 1 (anchors for
every pixel in the feature map), or 2 (every other pixel).
depth: Depth of the backbone feature map.
Returns a Keras Model object. The model outputs, when called, are:
rpn_logits: [batch, H, W, 2] Anchor classifier logits (before softmax)
rpn_probs: [batch, W, W, 2] Anchor classifier probabilities.
rpn_bbox: [batch, H, W, (dy, dx, log(dh), log(dw))] Deltas to be