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

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参考链接

posted @ 2018-03-08 18:11  默盒  阅读(6198)  评论(0编辑  收藏  举报