编程小白

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)

 

© 2023 编程小白. Generated with Hugo and Mainroad theme.