在使用TensorFlow 2.0最新版本时报错: AttributeError: module 'tensorflow' has no attribute 'Session' 原因 其实并不是不是安装错误,是因为在新的Tensorflow 2.0版本中已经移除了Session这一模块。 解决方法 运行下面代码替换tf.Session()即可 >>> tf.compat.v1.Session()