SHARE
TWEET

Untitled

a guest Apr 21st, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import tensorflow as tf
  2. from google.protobuf.json_format import MessageToJson
  3.  
  4. filename = 'myfile.tfrecords'
  5.  
  6. for record_str in tf.python_io.tf_record_iterator(filename):
  7.     example = tf.train.Example.FromString(record_str)
  8.     json = MessageToJson(example)
  9.     print(json)
  10.  
  11.     uin = input('Press Enter to contiue to next example [q to quit]: ').strip()
  12.     if uin.lower() == 'q':
  13.         return
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top