def save_tf_checkpoint(self, path): """ Save tensorflow checkpoint in this estimator. :param path: tensorflow checkpoint path. """ save_tf_checkpoint(self.sess, path)
def test_checkpoint_remote(self): tf.reset_default_graph() model = SimpleModel() sess = tf.Session() sess.run(tf.global_variables_initializer()) saver = tf.train.Saver(tf.global_variables()) temp = tempfile.mkdtemp() save_tf_checkpoint(sess, os.path.join(temp, "simple.ckpt"), saver) ckpt = get_checkpoint_state(temp) assert ckpt.model_checkpoint_path == os.path.join(temp, "simple.ckpt") assert ckpt.all_model_checkpoint_paths[0] == os.path.join(temp, "simple.ckpt") load_tf_checkpoint(sess, os.path.join(temp, "simple.ckpt"), saver) shutil.rmtree(temp)
def save_tf_checkpoint(self, path): save_tf_checkpoint(self.sess, path)