TensorFlow saves variables in binary checkpoint files that map variable
names to tensor values. vai_p_tensorflow takes a
checkpoint file as input to load trained weights. tf.train.Saver
provides methods to specify paths for the checkpoint
files.
The following code snippet calls the tf.train.Saver.save
method to save variables to checkpoint files:
with tf.Session() as sess:
# assemble the graph here
# ……
sess.run(train_op)
# Save the variables to disk.
save_path = saver.save(sess, "/tmp/model.ckpt")
print("Model saved in path: %s" % save_path)
The saved checkpoint files look like this:
model.ckpt.data-00000-of-00001
model.ckpt.index
model.ckpt.meta