1 Answers

Just use tensorflow Saver class to save the graph in checkpoints.

saver = tf.train.Saver()
# ...
with tf.Session() as sess:
  # your code here ...
  save_path = saver.save(sess, "/path/model.ckpt")
  print("Model saved in path: %s" % save_path)

and load with this way

# Add ops to save and restore all the variables.
saver = tf.train.Saver()

# Later, launch the model, use the saver to restore variables from disk, and
# do some work with the model.
with tf.Session() as sess:
  # Restore variables from disk.
  saver.restore(sess, "/path/model.ckpt")
  print("Model restored.")

Here is the doc of tensorflow https://www.tensorflow.org/guide/saved_model

Couldn't find what you were looking for?and we will find an expert to answer.
How helpful was this page?