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

用tensorflow2.0运行1版本的代码出现
在这里插入图片描述

解决方法:
在开头处添加代码:

tf.compat.v1.disable_eager_execution()

你可能感兴趣的:(tensorflow2)