(train_dir,
             eval_dir,
             config,
             dataset_fn,
             num_batches,
             master='')
Evaluate the model repeatedly.
Evaluate the model repeatedly.
Evaluate the model repeatedly .
def evaluate(train_dir,
             eval_dir,
             config,
             dataset_fn,
             num_batches,
             master=''):
  """Evaluate the model repeatedly."""
  tf.gfile.MakeDirs(eval_dir)

  _trial_summary(
      config.hparams, config.eval_examples_path or config.tfds_name, eval_dir)
  with tf.Graph().as_default():
    model = config.model
    model.build(config.hparams,
                config.data_converter.output_depth,
                is_training=False)

    eval_op = model.eval(
        **_get_input_tensors(dataset_fn().take(num_batches), config))

    hooks = [
        tf_slim.evaluation.StopAfterNEvalsHook(num_batches),
        tf_slim.evaluation.SummaryAtEndHook(eval_dir)
    ]
    tf_slim.evaluation.evaluate_repeatedly(
        train_dir,
        eval_ops=eval_op,
        hooks=hooks,
        eval_interval_secs=60,
        master=master)
def evaluate ( train_dir , eval_dir , config , dataset_fn , num_batches , master = '' ) : tf . gfile . MakeDirs ( eval_dir ) _trial_summary ( config . hparams , config . eval_examples_path or config . tfds_name , eval_dir ) with tf . Graph ( ) . as_default ( ) : model = config . model model . build ( config . hparams , config . data_converter . output_depth , is_training = False ) eval_op = model . eval ( * * _get_input_tensors ( dataset_fn ( ) . take ( num_batches ) , config ) ) hooks = [ tf_slim . evaluation . StopAfterNEvalsHook ( num_batches ) , tf_slim . evaluation . SummaryAtEndHook ( eval_dir ) ] tf_slim . evaluation . evaluate_repeatedly ( train_dir , eval_ops = eval_op , hooks = hooks , eval_interval_secs = 60 , master = master )