我发现tf.saved_model文档不清晰,没有任何有价值的资源如何阅读其他会话中训练模型?
这是一样简单:
# Clear the default graph if any
tf.reset_default_graph()
# Create a saver/loader object
loader = tf.train.Saver()
# Build the same graph architecture (Easiest to do with a class)
model = YourModel()
# Create a session
with tf.Session() as sess:
# Initialize the variables in the graph
sess.run(tf.global_variables_initializer())
# Restore the learned weights from a saved checkpoint
loader.restore(sess, path_to_checkpoint_dir)