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