Tensorflow 读取序列化数据示例未定义 tf.FixedLenFeature

Tensorflow read serialized data example undefined tf.FixedLenFeature

我正尝试按照此处的建议使用原型接口使用序列化数据

https://www.tensorflow.org/versions/master/how_tos/reading_data/index.html#reading-from-files

我尝试使用示例: https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/examples/how_tos/reading_data/fully_connected_reader.py

但它失败了,因为:

In [99]: tf.FixedLenFeature
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-99-e5629528302a> in <module>()
----> 1 tf.FixedLenFeature

AttributeError: 'module' object has no attribute 'FixedLenFeature'

我想我在这里遗漏了一些东西......

fully_connected_reader.py 的版本包括一些(中断)changes to the tf.parse_example() API,这些是在 TensorFlow 0.6.0 发布之后制作的。这些更改包括添加 tf.FixedLenFeature class 作为定义要在 tf.parse_example() 中使用的模式的助手。您应该从源代码构建 TensorFlow 或等待即将发布的 0.7.0 版本以使用此版本的 API.

或者,旧版本的示例代码可用 here, and the documentation for tf.parse_example() is available here