【tensorflow】 :AttributeError: module ‘tensorflow‘ has no attribute ‘app‘

AttributeError: module ‘tensorflow’ has no attribute ‘app’

solution:
import tensorflow ad tf 改为 import tensorflow.compat.v1 as tf

之后又报错:

sess.run(tf.global_variables_initializer())
TypeError: Fetch argument None has invalid type

添加

#import tensorflow ad tf 
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

你可能感兴趣的:(DeepLearning)