Reputation: 7967
I have a tfrecords
file and want to view the contents of the file using tensorflow's TFRecordReader
. I want to display the contents of the file in the command prompt but haven't gotten anywhere. Any directions would help
Upvotes: 1
Views: 2446
Reputation: 3211
If you are looking for information on how to use the TFRecordReader class, this example has some code that uses it: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/how_tos/reading_data/fully_connected_reader.py which is linked from https://www.tensorflow.org/how_tos/reading_data/ . The reference documentation is here: https://www.tensorflow.org/versions/r0.12/api_docs/python/io_ops/readers .
If you just want to view the contents of a TFRecord file as bytes, the tf.python_io.tf_record_iterator class should do what you want. It is defined here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/lib/io/tf_record.py
Here's an example of code that uses it: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/gcs_test/python/gcs_smoke.py
Upvotes: 1