[TensorFlow] NumPy array to tensorFlow DataSet

Example

dataset = tf.data.Dataset.from_tensor_slices(DATA).repeat().batch(BATCH_SIZE)
iterator = dataset.make_initializable_iterator()
next_element = iterator.get_next()

sess = tf.Session()
sess.run(iterator.initializer)
for i in range(ITERATION):
training_batch = sess.run(next_element)

Reference

http://adventuresinmachinelearning.com/tensorflow-dataset-tutorial/
https://towardsdatascience.com/how-to-use-dataset-in-tensorflow-c758ef9e4428

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.