A common viewer to inspect/dump any Tensor Flow TFRecord file into console. This is a simple tool that provides you a good insight into the internal structure of *.tfrecord
files.
If you want to run in a new anaconda env, run this:
conda create -n tfrecord_viewer python=3.10
conda activate tfrecord_viewer
Install tensorflow:
pip install tensorflow
In tfrecord_viewer.py
, change TFRECORD_PATH
to inspect any TFRecord file you want to view.
Then run python tfrecord_viewer.py
, the TFRecord will be dumped in console.
Below are some example results:
TFRecord | Console Output |
---|---|
test.tfrecord | ![]() |
mnist.tfrecord | ![]() |
nyu_rot.tfrecord | ![]() |
Feel free to modify the runtime parameters:
FIRST_N_RECORDS = 3
BYTES_LIST_PRINT_START_ELEMENTS = 2
BYTES_LIST_PRINT_TRAILING_ELEMENTS = 2
BYTES_LIST_MAX_BINARY_PRINT_LEN = 32
FLOAT_LIST_START_PRINT_LEN = 8
FLOAT_LIST_TRAILING_PRINT_LEN = 5
INT_LIST_START_PRINT_LEN = 8
INT_LIST_TRAILING_PRINT_LEN = 5