运行时,出现了AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘

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

代替

 import tensorflow as tf

我是在视频上学的写法,不明白为什么老师运行没有报错,自己就要这么替换一下

你可能感兴趣的:(深度学习)