运行pixellib出现错误

1.实例分割
Traceback (most recent call last):
File “test_pixellib.py”, line 11, in
segment_image.load_model(“mask_rcnn_shapes_0030.h5”)
File “/home/han/miniconda3/envs/pixellib_test/lib/python3.7/site-packages/pixellib/instance.py”, line 45, in load_model
self.model.load_weights(model_path, by_name= True)
File “/home/han/miniconda3/envs/pixellib_test/lib/python3.7/site-packages/pixellib/mask_rcnn.py”, line 2111, in load_weights
hdf5_format.load_weights_from_hdf5_group_by_name(f, layers)
File “/home/han/miniconda3/envs/pixellib_test/lib/python3.7/site-packages/tensorflow/python/keras/saving/hdf5_format.py”, line 788, in load_weights_from_hdf5_group_by_name
str(weight_values[i].shape) + ‘.’)
ValueError: Layer #391 (named “mrcnn_bbox_fc”), weight <tf.Variable ‘mrcnn_bbox_fc/kernel:0’ shape=(1024, 324) dtype=float32> has shape (1024, 324), but the saved weight has shape (1024, 8).

解决:
https://github.com/matterport/Mask_RCNN/issues/849

在/instance.py", line 45, in load_model
self.model.load_weights(model_path, by_name= True)中加
model.load_weights(filepath, by_name=True, exclude=[ “mrcnn_class_logits”, “mrcnn_bbox_fc”, “mrcnn_bbox”, “mrcnn_mask”])

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值