Wednesday, March 28, 2018

modify tensorflow checkpoint path

The saved checkpoint stored the model absolute path. If you changed some path, you need to update the stored paths in checkpoint.

Two functions in
https://github.com/tensorflow/tensorflow/blob/r1.6/tensorflow/python/training/saver.py

1. get original state
get_checkpoint_state(checkpoint_dir, latest_filename=None)

2. Update the paths, similar in the got paths

def update_checkpoint_state(save_dir,model_checkpoint_path,
all_model_checkpoint_paths=None,
latest_filename=None)

# all_model_checkpoint_paths is a list