出现 AttributeError: module ‘tensorflow’ has no attribute ‘Session’ 因为在新的Tensorflow 2.0版本中已经移除了Session这一模块 新代码写法: import tensorflow as tf tf.compat.v1.Session()