Save checkpoints .ckpt less frequently Object Detection API
Hi, I am using the object detection API with my own dataset, I trained succesfully the faster_rcnn_inception_v2, but i want to save the checkponts .ckpt less frequently. Actually the model saves the 5 last, with a frequency of 5 minutes. I want to save checkpoints with a frequency of 1 hour for example.
Thanks for your attention.
Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. What is the top-level directory of the model you are using Have I written custom code OS Platform and Distribution TensorFlow installed from TensorFlow version Bazel version CUDA/cuDNN version GPU model and memory Exact command to reproduce
Consider setting the eval_interval_secs field in the eval proto to 3600 for a one hour eval period.
Thanks @derekjchow for the quick reply.
@derekjchow Thanks for the answer, but I tried and doesn't work. The model always saves the .ckpt files with a frequency of 10 minutes. I saw the train.proto too, and I have not seen nothing related with the .ckpt checkpoint savings during the trainning. I want to save checkpoints with a frequency of 1 hour
@AdrianSalvador Hi, I am having the same problem. Any solutions?
@joydeepmedhi I found the solution! In trainer.py,if you are using the slim based. If you want to change the number of .ckpt model to keep yo must change the line 370 to: saver = tf.train.Saver( keep_checkpoint_every_n_hours=keep_checkpoint_every_n_hours, max_to_keep=10) In this case you will preserve the 10 last .ckpt
If you want to change the frequency of the .ckpt you must add inside of the slim.learning.train (line 397) save_interval_secs=X
where X is the frequency in seconds
hi, I'd like to know if there is any ohter way to save ckpt in a regular time? I also want to know how to save ckpt in a regular step in the api code? Anyone could help?
@derekjchow I think eval_interval_secs does not influence the frequency of SAVING the checkpoints, which, does not answer the issue. Regardless, the model is saved around every 10 minutes. Also, flag keep_checkpoint_every_n_hours DO NOT work. Changing its value does not change the frequency to save the checkpoints.
Any ideas to how to save the checkpoints less frequently? Cause current object detection api has an issue of memory leak, which is possibly caused by saving checkpoints. Please refer to https://github.com/tensorflow/models/issues/5139 for more details about memory leak.
I think I've figured out how to adjust the frequency of saving checkpoint and evaluation. explaind here https://github.com/tensorflow/models/issues/5139#issuecomment-418963839