如果你的tensorflow已安装了,运行到下一句时出现错误
writer = tf.python_io.TFRecordWriter("flower_train.tfrecords")
出现 module 'tensorflow' has no attribute 'python_io'的错误
角决方法:这是版本问题,用在phthon_io前面加compat.v1 如下所示
writer = tf.compat.v1.python_io.TFRecordWriter("flower_train.tfrecords")
但后面仍可能出错,
用import tensorflow.compat.v1 as tf 可能会更好。



