错误:AttributeError: module 'tensorflow' has no attribute 'placeholder'
错误信息:
AttributeError: module 'tensorflow' has no attribute 'placeholder'
错误原因:
TensorFlow 2中使用TensorFlow 1中的API
解决方法:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
替换
import tensorflow as tf