Watch talks from the 2019 TensorFlow Dev Summit Watch now

tf.data.make_initializable_iterator

tf.data.make_initializable_iterator(dataset)

Defined in tensorflow/python/data/ops/dataset_ops.py.

Creates a tf.data.Iterator for enumerating the elements of a dataset.

dataset = ...
iterator = dataset.make_initializable_iterator()
# ...
sess.run(iterator.initializer)

Args:

Returns:

A tf.data.Iterator over the elements of dataset.

Raises:

  • RuntimeError: If eager execution is enabled.