转移学习问题:使用我自己的训练的权重,或者是USIIGACI训练有素的MRCNN(Matterport实施)
我的项目涉及细胞检测,所以我想我尝试使用 usiigaci预先训练的权重 。 但是,当我尝试时,我会收到以下错误: valueerror:第362页(命名为“锚”)期望1个权重,但是保存的权重为0个元素
。 例如,该培训适合预估计的可可丝。 这是我用来加载权重的代码:
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"])
如果您了解为什么会发生这种情况,请告诉我。 谢谢!!
my project involves cell detection, so I thought I'd try training my NN using Usiigaci pre-trained weights.
but when I try I get the following error:ValueError: Layer #362 (named "anchors") expects 1 weight(s), but the saved weights have 0 element(s)
.
The training works fine for pretrained coco weigths for example.
this is the code i use to load the weights:
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"])
I also get a similar problem when trying to load the weights that were generated by training my model over my own photos, to continue the training where I stopped the last time.
the error received is:
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).
loading the weights:
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"])
please let me know if you understand why is this happening.
thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论