【发布时间】:2020-05-19 07:34:24
【问题描述】:
我正在使用 colab 在 tensorflow 排名上运行 tutorial。它使用 wget 来获取 tfrecord:
!wget -O "/tmp/train.tfrecords" "http://ciir.cs.umass.edu/downloads/Antique/tf-ranking/ELWC/train.tfrecords"
我正在使用这段代码来尝试查看 tfrecord 的结构:
for example in tf.compat.v1.python_io.tf_record_iterator("/tmp/train.tfrecords"):
print(tf.train.Example.FromString(example))
break
我得到:
DecodeError: Error parsing message
一般怎么看tfrecords的结构呢?
第二个问题:在哪里可以找到像 tf.train.Example 这样的类的文档?我刚找到这个empty page。
【问题讨论】:
标签: python tensorflow tensorflow-datasets