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

前端 未结 4 1556
暖寄归人
暖寄归人 2021-02-02 07:14

I have upgraded with tf_upgrade_v2 TF1 code to TF2. I\'m a noob with both. I got the next error:

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


        
4条回答
  •  清酒与你
    2021-02-02 08:15

    I found an easy solution here: disable Tensorflow eager execution

    Basicaly it is:

    tf.compat.v1.disable_eager_execution()

    With this, you disable the default activate eager execution and you don't need to touch the code much more.

提交回复
热议问题