问题类型
TypeError: Cannot convert a symbolic Keras input/output to a numpy array. This error may indicate that you’re trying to pass a symbolic value to a NumPy call, which is not supported. Or, you may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model.
原因
Keras 和tensorflow的版本匹配问题
解决方案
1.升级自己的tensorflow版本
pip install --upgrade tensorflow
升级至2.**版本中自带Keras ,这时你可以选择不安装Keras
2.打开下面链接查看自己tensorflow版本对应的keras版本
https://docs.floydhub

当尝试将Keras的符号输入/输出转换为NumPy数组时出现TypeError,这可能是版本不兼容导致的。解决方案包括升级TensorFlow到2.**版本,或者根据TensorFlow版本安装对应兼容的Keras版本。执行相关pip安装命令后,需重新导入keras。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



