Tensorflow: Saver / tf.train.latest_checkpoint doesn't work very well with relative paths

Created on 20 Dec 2015  路  3Comments  路  Source: tensorflow/tensorflow

For example, if model is saved into a folder test by doing saver.save(session, '/path/to/test') - will result in the having checkpoints and model-0 files. Where checkpoints file will have something like this:

model_checkpoint_path: "test/model-0"
all_model_checkpoint_paths: "test/model-0"

Which if you call now tf.train.latest_checkpoint('test') from the same directory, will result in the None.

This is due to os.path.join(checkpoint_dir, ckpt.model_checkpoint_path) which for relative path like above will result in the test/test/model-0.

Most helpful comment

This issue persists when you change the name of the run folder. It seems that the checkpoints/checkpoint file only keep the old path and tf fails when latest_checkpoint is used over this new folder.

All 3 comments

Fixed by:
Change-Id: I47d8536b9b2ed3dcc193d6e6b7f4573a4e22c9b3

We abandoned the gerrit one -- if https://github.com/tensorflow/tensorflow/pull/573 looks good, we can merge

This issue persists when you change the name of the run folder. It seems that the checkpoints/checkpoint file only keep the old path and tf fails when latest_checkpoint is used over this new folder.

Was this page helpful?
0 / 5 - 0 ratings