【问题标题】:problems with transfer learning: using my own trained weights, or the Usiigaci trained wieghts for MRCNN (matterport implementation)迁移学习的问题:使用我自己训练的权重,或者为 MRCNN 训练的 Usiigaci 权重(matterport 实现)
【发布时间】:2022-08-22 21:04:53
【问题描述】:

我的项目涉及细胞检测,所以我想我会尝试使用Usiigaci pre-trained weights 训练我的神经网络。 但是当我尝试时出现以下错误: ValueError: Layer #362 (named \"anchors\") expects 1 weight(s), but the saved weights have 0 element(s)。 例如,对于预训练的 coco 重量,训练效果很好。 这是我用来加载权重的代码:

model = MaskRCNN(mode=\'training\', model_dir=\'./\', config=config) model.load_weights(\'Usiigaci_3.h5\', by_name=True, exclude=[\"mrcnn_class_logits\", \"mrcnn_bbox_fc\", \"mrcnn_bbox\", \"mrcnn_mask\"])

当我尝试加载通过在我自己的照片上训练我的模型生成的权重时,我也遇到了类似的问题,以继续我上次停止的训练。 收到的错误是:

ValueError: Layer #362 (named \"anchors\"), weight <tf.Variable \'Variable:0\' shape=(4, 261888, 4) dtype=float32> has shape (4, 261888, 4), but the saved weight has shape (2, 261888, 4).

加载重量:

model.load_weights(\'new_weigths/40_epochs/mask_rcnn_cell_cfg_0040.h5\', by_name=True, exclude=[\"mrcnn_class_logits\", \"mrcnn_bbox_fc\", \"mrcnn_bbox\", \"mrcnn_mask\"])

如果您了解为什么会这样,请告诉我。 谢谢!!

    标签: python tensorflow neural-network recurrent-neural-network transfer-learning


    【解决方案1】:

    你解决这个问题了吗?如果是,请与我分享什么有效?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-15
      • 2013-08-05
      • 2020-01-12
      • 2012-08-20
      • 2018-07-13
      • 1970-01-01
      • 2018-03-18
      • 2018-01-13
      相关资源
      最近更新 更多