MCPcopy
hub / github.com/hanzhanggit/StackGAN / evaluate

Method evaluate

stageII/trainer.py:655–669  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

653 count += self.batch_size
654
655 def evaluate(self):
656 config = tf.ConfigProto(allow_soft_placement=True)
657 with tf.Session(config=config) as sess:
658 with tf.device("/gpu:%d" % cfg.GPU_ID):
659 if self.model_path.find('.ckpt') != -1:
660 self.init_opt()
661 print("Reading model parameters from %s" % self.model_path)
662 saver = tf.train.Saver(tf.all_variables())
663 saver.restore(sess, self.model_path)
664 # self.eval_one_dataset(sess, self.dataset.train,
665 # self.log_dir, subset='train')
666 self.eval_one_dataset(sess, self.dataset.test,
667 self.log_dir, subset='test')
668 else:
669 print("Input a valid model path.")

Callers 1

run_exp.pyFile · 0.45

Calls 2

init_optMethod · 0.95
eval_one_datasetMethod · 0.95

Tested by

no test coverage detected