注:安装好Tensorflow2.0后,当使用Session时,报错AtributeError: module ‘tensorflow’ has no attribute ‘Session’:
错误的意思是tensorflow模块没有Session属性,后来查阅资料发现,tensorflow2.0版本中的确没有Session这个属性
解决问题如下:`
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
sess = tf.compat.v1.Session()