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_第1张图片

链接:

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

 

你可能感兴趣的:(tensorflow,人工智能,python)