tensorflow2.0运行1.0的代码会报错误:“AttributeError: module 'tensorflow' has no attribute 'placeholder'”
解决方案:
import tensorflow.compat.v1 as tf
并在代码中关闭eager运算:
tf.disable_eager_execution()
tensorflow2.0运行1.0的代码会报错误:“AttributeError: module 'tensorflow' has no attribute 'placeholder'”
解决方案:
import tensorflow.compat.v1 as tf
并在代码中关闭eager运算:
tf.disable_eager_execution()