After you train a model in Tensorflow:
You can save the variables in the network using
saver = tf.train.Saver()
saver.save(sess, 'path of save/fileName.ckpt')
To restore the network for reuse later or in another script, use:
saver = tf.train.Saver()
saver.restore(sess, tf.train.latest_checkpoint('path of save/')
sess.run(....)
Important points:
sess
must be same between first and later runs (coherent structure). saver.restore
needs the path of the folder of the saved files, not an individual file path.