更新时间: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.
简单的解决方案是永远不要将keras
与tf.keras
混合使用.
The simple solution is to never mix keras
with tf.keras
.