Missed TensorFlow World? Check out the recap. Learn more



Defined in tensorflow/contrib/data/python/ops/iterator_ops.py.

Returns a SaveableObject for saving/restore iterator state using Saver. (deprecated)

THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use tf.data.experimental.make_saveable_from_iterator(...).


  • iterator: Iterator.

For example:

with tf.Graph().as_default():
  ds = tf.data.Dataset.range(10)
  iterator = ds.make_initializable_iterator()
  # Build the iterator SaveableObject.
  saveable_obj = tf.contrib.data.make_saveable_from_iterator(iterator)
  # Add the SaveableObject to the SAVEABLE_OBJECTS collection so
  # it can be automatically saved using Saver.
  tf.add_to_collection(tf.GraphKeys.SAVEABLE_OBJECTS, saveable_obj)
  saver = tf.train.Saver()

  while continue_training:
    ... Perform training ...
    if should_save_checkpoint: