New checkpoint format in TensorFlow R12
Suddenly, when restore checkpoint save by the TensorFlow R12 with old version, some errors occurs:
According to the TensorFlow v0.12.0 RC0’s release note:
New checkpoint format becomes the default in tf.train.Saver. Old V1 checkpoints continue to be readable; controlled by the write_version argument, tf.train.Saver now by default writes out in the new V2 format. It significantly reduces the peak memory required and latency incurred during restore.
tf.train.Saver has a new checkpoint format with
write_version flag V2, and old format with V1. For example:
|old format (V1)||new format (V2)|
What if we want to use the old trained checkpoint? So I look into the source file of saver.py, and find out the init function of the
We can easily save trained checkpoint in the old way like this:
However, we will get lots of WARNING … :
So, once we migrate our tf code to R12, we’d better use the new checkpoint format for better performance.