问题1:AttributeError: module 'tensorflow' has no attribute 'placeholder'
解决:
使用
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
替换
import tensorflow as tf
问题2:'module' object has no attribute 'scalar_summary'
解决:
tf.scalar_summary('images', images)改为:tf.summary.scalar('images', images)
tf.image_summary('images', images)改为:tf.summary.image('images', images)