Reputation: 53
I use tf.train.Supervisor to start a session to train my model, and save model parameter every 1000 steps. But it seems that tensorflow would automatically delete old model files. Only 5 recent models were saved. Once model.ckpt-6000 is produced, the model.ckpt-1000 is deleted. But I can not find any documents on this operation.
Upvotes: 2
Views: 1681
Reputation: 5162
Here are the docs: https://www.tensorflow.org/api_docs/python/tf/train/Saver
It has a variable called max_to_keep which defaults to 5. So just call
tf.train.Saver(max_to_keep=100000)
or some other large number that encompasses all that might be created. No way to save all models as an option that I know of.
Update: as Ferran Parés points out in a comment just set max_to_keep=None to save all of the outputs.
tf.train.Saver(max_to_keep=None)
Upvotes: 3