a guest Apr 21st, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- import tensorflow as tf
- from google.protobuf.json_format import MessageToJson
- filename = 'myfile.tfrecords'
- for record_str in tf.python_io.tf_record_iterator(filename):
- example = tf.train.Example.FromString(record_str)
- json = MessageToJson(example)
- uin = input('Press Enter to contiue to next example [q to quit]: ').strip()
- if uin.lower() == 'q':
RAW Paste Data