源码:# 解析读取的样例。
features = tf.parse_single_example(dataset,features={'image_raw':tf.FixedLenFeature([],tf.string),'pixels':tf.FixedLenFeature([],tf.int64),'label':tf.FixedLenFeature([],tf.int64)})

吴裕雄--天生自然 pythonTensorFlow图形数据处理:解决module 'tensorflow' has no attribute 'parse_single_example'

修改后:
# 解析读取的样例。
features = tf.io.parse_single_example(dataset,features={'image_raw':tf.FixedLenFeature([],tf.string),'pixels':tf.FixedLenFeature([],tf.int64),'label':tf.FixedLenFeature([],tf.int64)})

这样就可以了解决这个问题了。

相关文章: