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

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

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