code: def run_evaluator(task_spec, checkpoints_path, batch_size=32):
      with tf.Graph().as_default():
          # load dataset
          (
              images_input,
              one_hot_classes,
              num_classes,
              _dataset_size,
          ) = load_data(
              file=VAL_FILE,
              task_spec=task_spec,
              batch_size=batch_size,
              epochs=1,
          )
          _network, predictions = build_network(
              images_input, num_classes=num_classes, is_training=False
          )
          saver = tf.train.Saver()
          # metrics
          metrics_init_ops, _, metrics_ops = calculate_metrics(
              predicted_batch=predictions,
              real_batch=one_hot_classes,
              is_training=False,
          )
          # tensorboard summary
          summary_op = tf.summary.merge_all()
          # session hook
          evaluator_hook = EvaluatorHook(
              checkpoints_path=checkpoints_path, saver=saver
          )
  
          try:
              # infinite loop
              while True:
                  with SingularMonitoredSession(
                      hooks=[evaluator_hook]
                  ) as sess:
                      sess.run(metrics_init_ops)
                      try:
                          while not sess.should_stop():
                              metrics, summary = sess.run(
                                  [metrics_ops, summary_op]
                              )
                              evaluator_hook.summary = summary
                      except OutOfRangeError:
                          pass
                      logging.info(
                          "step: {}  {}".format(
                              evaluator_hook.eval_step, metrics
                          )
                      )
          except EvaluatorStops:
              # the evaluator has waited too long for a new checkpoint
              pass
  
imports: import argparse
  import logging
  import multiprocessing
  import os
  import random
  import sys
  import time
  from xml.etree import ElementTree
  import numpy
  import tensorflow
  from tensorflow.contrib import slim
  from tensorflow.contrib.slim.python.slim.nets.inception_v3 import inception_v3, inception_v3_arg_scope
  from tensorflow.python.framework.errors_impl import OutOfRangeError
  from tensorflow.python.training import session_run_hook
  from tensorflow.python.training.basic_session_run_hooks import StopAtStepHook
  from tensorflow.python.training.monitored_session import SingularMonitoredSession
  import tensorlayer
label_desc: Use image node_id 8 for calling a global function with example usage: run_evaluator(task_spec, checkpoints_path, batch_size) without return types