Mask R-CNN Windows运行报错及改正记录
环境
tensorflow1.15.0
Keras2.3.1
尤其注意这俩:
h5py2.10.0
scikit-image0.17.2
错误
1.报错信息:
Input image dtype is bool. Interpolation is not defined with bool data type
解决方案:
pip install -U scikit-image==0.16.2
2.报错信息:
File “/home/xxq/anaconda3/envs/maskrcnn/lib/python3.6/site-packages/keras/engine/topology.py”, line 3114, in load_weights_from_hdf5_group_by_name
original_keras_version = f.attrs[‘keras_version’].decode(‘utf8’)
AttributeError: ‘str’ object has no attribute ‘decode’
解决方案:
pip install h5py==2.10.0
3.报错信息:
ValueError: Layer #389 (named “mrcnn_bbox_fc”), weight <tf.Variable ‘mrcnn_bbox_fc/kernel:0’ shape=(1024, 8) dtype=float32> has shape (1024, 8), but the saved weight has shape (1024, 324).
解决:
load_weights时需要exclude几层。
model.load_weights(COCO_MODEL_PATH, by_name=True,
exclude=[“mrcnn_class_logits”, “mrcnn_bbox_fc”, “mrcnn_bbox”, “mrcnn_mask”])