我用的是tensorflow 2.0 ,所以用了import tensorflow as tf 就出现了这个错误:module ‘tensorflow’ has no attribute ‘placeholder’
把import tensorflow as tf 替换为:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
就可以了
我用的是tensorflow 2.0 ,所以用了import tensorflow as tf 就出现了这个错误:module ‘tensorflow’ has no attribute ‘placeholder’
把import tensorflow as tf 替换为:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
就可以了