Inspecting TFRecord files and debugging TensorFlow data input
TFrecord files are TensorFlow’s suggested data format, although they are very difficult to inspect given their binary nature. Inspecting the contents of existing record files and ensuring the data in your input pipeline is as you expect is a good technique to have. Inspecting TFRecord values The first trick is reading in the tfrecord files and inspecting their values in python. As you’d expect, the TensorFlow API allows this (although a little hidden down). The small code snippet below highlights using the tf.python_io.tf_record_iterator to inspect ’examples’ in your record file. Replace the ’label’ or ’text_label’ as appropriate for your features, but it shows you can dot access into the property values ...