Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. writer = tf.python_io.TFRecordWriter(output_file)
  2. with tf.gfile.FastGFile(file_path, 'rb') as f:
  3. data = f.read()
  4. example = tf.train.Example(features=tf.train.Features(feature={
  5. 'data': tf.train.Feature(bytes_list=tf.train.BytesList(value=[data])) }))
  6. writer.write(example.SerializeToString())
  7.  
  8. Tensor("X/ParseSingleExample/ParseSingleExample:0", shape=(), dtype=string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement