0.10rc0, -, , tf.saver(). tf.train.Saver(). , save save_path global_step, save_path, .
, , - SessionManager :
my_checkpoint_dir = "/tmp/checkpoint_dir"
saver = tf.train.Saver()
init = tf.initialize_all_variables()
sm = tf.train.SessionManager()
sess = sm.prepare_session("", init_op=init, saver=saver, checkpoint_dir=my_checkpoint_dir))
. , my_checkpoint_dir (, ), , init_op .
, , , global_step. , global_step, , , :
checkpoint_path = os.path.join(my_checkpoint_dir, 'model.ckpt')
saver.save(sess, checkpoint_path, global_step=step)
my_checkpoint_dir, "model.ckpt-1000", 1000 - global_step. , "model.ckpt-2000". SessionManager . checkpoint_path , checkpoint_dir. Save() global_step ( ). " ", SessionManager .