Keras读取保存的模型时, 产生错误[ValueError: Unknown activation function:relu6]

Keras读取保存的模型时, 产生错误[ValueError: Unknown activation function:relu6]

https://www.cnblogs.com/ZhengPeng7/p/8530065.html

Solution:

from keras.utils.generic_utils import CustomObjectScope

with CustomObjectScope({'relu6': keras.applications.mobilenet.relu6,'DepthwiseConv2D': keras.applications.mobilenet.DepthwiseConv2D}):
    model = load_model('model_saved.hdf5')

官方github相关issue参考链接

猜你喜欢

转载自blog.csdn.net/qq_34106574/article/details/90034945