且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

加载keras保存的模型时发生TypeError:('Keyword参数不被理解:','module')

更新时间:2023-12-01 23:19:46

您没有使用Keras 2.2.4构建模型,而是使用tf.keras构建了模型,现在您正在使用keras加载模型.这两个模块实际上都不兼容,这就是为什么您会出错的原因.

You didn't build the model using Keras 2.2.4, you built it using tf.keras, and now you are loading it with keras. Both modules are not actually compatible and this i why you get an error.

简单的解决方案是永远不要将kerastf.keras混合使用.

The simple solution is to never mix keras with tf.keras.