TypeError: You are passing KerasTensor

报错如下:

解决:(我使用的是tf2.9.0版本)

在最开始处加入这两句代码就可以了

from tensorflow.python.framework.ops import disable_eager_execution
disable_eager_execution()

参考github上一位大佬的解决方案

链接:

TypeError: You are passing KerasTensor... Keras Functional model construction only supports TF API calls... · Issue #16066 · keras-team/keras (github.com)

 

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>