def run(self):
"""Run evaluation."""
# Create logging directory if not exists.
if not os.path.isdir(self._eval_log_dir):
os.makedirs(self._eval_log_dir)
# Compute loss function and other evaluating metrics.
self._initialize()
# Visualize input images in Tensorboard.
self._summary_ops.append(tf.image_summary("Eval_Image", self._observations, max_images=5))
# Use `slim.evaluation.evaluation_loop` to evaluate the model periodically.
slim.evaluation.evaluation_loop(
master='',
checkpoint_dir=self._train_log_dir,
logdir=self._eval_log_dir,
num_evals=self._config.num_batches,
eval_op=self._metrics_to_updates.values(),
summary_op=tf.merge_summary(self._summary_ops),
eval_interval_secs=self._config.eval_interval_secs)
评论列表
文章目录