AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘
错误描述AttributeError: module 'tensorflow' has no attribute 'Session'因为代码是tf1.0的,而你用的环境是tf2.0的所以,两种解决方法方法一import tensorflow.compat.v1 as tf方法二或者在tf和函数之间加上compat.v1tf.compat.v1.Session()第二种方法比较麻烦。...