MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / load

Method load

GAN/Self_attention_GAN_tensorflow/SAGAN.py:406–420  ·  view source on GitHub ↗
(self, checkpoint_dir)

Source from the content-addressed store, hash-verified

404 self.saver.save(self.sess, os.path.join(checkpoint_dir, self.model_name+'.model'), global_step=step)
405
406 def load(self, checkpoint_dir):
407 import re
408 print(" [*] Reading checkpoints...")
409 checkpoint_dir = os.path.join(checkpoint_dir, self.model_dir)
410
411 ckpt = tf.train.get_checkpoint_state(checkpoint_dir)
412 if ckpt and ckpt.model_checkpoint_path:
413 ckpt_name = os.path.basename(ckpt.model_checkpoint_path)
414 self.saver.restore(self.sess, os.path.join(checkpoint_dir, ckpt_name))
415 counter = int(next(re.finditer("(\d+)(?!.*\d)",ckpt_name)).group(0))
416 print(" [*] Success to read {}".format(ckpt_name))
417 return True, counter
418 else:
419 print(" [*] Failed to find a checkpoint")
420 return False, 0
421
422 def visualize_results(self, epoch):
423 tot_num_samples = min(self.sample_num, self.batch_size)

Callers 15

trainMethod · 0.95
testMethod · 0.95
main.pyFile · 0.80
dehaze_imageFunction · 0.80
__init__Method · 0.80
load_pretrained_modelMethod · 0.80
test.pyFile · 0.80
cyclegan.pyFile · 0.80
esrgan.pyFile · 0.80
test_on_image.pyFile · 0.80
load_CIFAR_batchMethod · 0.80
unpickleFunction · 0.80

Calls

no outgoing calls

Tested by 2

mainFunction · 0.64
mainFunction · 0.64