Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import tensorflow as tf
- data_np = np.random.randint(0, 100, (100, 5))
- dataset = tf.data.Dataset.from_tensor_slices((data_np)).shuffle(100).batch(20)
- iterator = dataset.make_one_shot_iterator()
- next_batch = iterator.get_next()
- sess = tf.Session()
- while True:
- try:
- print(sess.run(next_batch))
- except tf.errors.OutOfRangeError:
- break
Add Comment
Please, Sign In to add comment