Tensorflow AttributeError: module 'tensorflow' has no attribute 'Session'
工作环境:Mac系统 Anaconda Opencv Tensorflow
#Tensorflow 2 删除了tf.Session()模块,用tf.compat.v1.disable_eager_execution()来代替,更加简单方便。
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
x=tf.constant('hello tensorflow!') #创建字符串
print('x')