当前位置: 代码迷 >> 综合 >> Attempting to capture an EagerTensor without building a function
  详细解决方案

Attempting to capture an EagerTensor without building a function

热度:59   发布时间:2024-02-26 18:33:45.0

tf2和tf1的版本问题

RuntimeError: tf.placeholder() is not compatible with eager execution.

加上代码后

import tensorflow.compat.v1 as tf

继续报错

Attempting to capture an EagerTensor without building a function

再添加代码

tf.disable_v2_behavior()

问题解决 

  相关解决方案