Guest User

Untitled

a guest
Nov 18th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <read files>
  2. image = tf.image.decode_png(file_contents)
  3. label = tf.string_to_number(label_str, out_type=tf.int32)
  4. # Batch examples here into two queues.
  5. image_batch, label_batch = tf.train.shuffle_batch(
  6. [image, label], ... )
  7. model = build_model(image_batch)
  8. loss = build_loss(model, label_batch)
  9.  
  10. (model_output, ) = sess.run([model]) # Uses the image queue as input
  11. (model_output, true_labels) = sess.run([model, label_batch]) # Are image/labels pairs valid?
  12.  
  13. train_predict = model(train_input)
  14. do something with the label here...
  15. alternate:
  16. use_predict = model(use_input, reuse=true)
Add Comment
Please, Sign In to add comment