Guest User

Untitled

a guest
Sep 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import numpy as np
  2. import tensorflow as tf
  3.  
  4. data_np = np.random.randint(0, 100, (100, 5))
  5. dataset = tf.data.Dataset.from_tensor_slices((data_np)).shuffle(100).batch(20)
  6. iterator = dataset.make_one_shot_iterator()
  7. next_batch = iterator.get_next()
  8.  
  9. sess = tf.Session()
  10. while True:
  11. try:
  12. print(sess.run(next_batch))
  13. except tf.errors.OutOfRangeError:
  14. break
Add Comment
Please, Sign In to add comment