 <p>You need to calculate the classification accuracy on the validation-set and keep track of the best one seen so far, and only write the checkpoint once an improvement has been found to the validation accuracy.</p> <p>If the data-set and/or model is large, then you may have to split the validation-set into batches to fit the computation in memory.</p> <p>This tutorial shows exactly how to do what you want:</p> <p><a href="https://github.com/Hvass-Labs/TensorFlow-Tutorials/blob/master/04_Save_Restore.ipynb" rel="nofollow">https://github.com/Hvass-Labs/TensorFlow-Tutorials/blob/master/04_Save_Restore.ipynb</a></p> <p>It is also available as a short video:</p> <p><a href="https://www.youtube.com/watch?v=Lx8JUJROkh0" rel="nofollow">https://www.youtube.com/watch?v=Lx8JUJROkh0</a></p>