import tensorflow as tf

          predictions[key[5::]] = val
        if key[0:3] == 'gt_':
          groundtruths[key[3::]] = val
        if key[0:5] == 'loss_':
          losses[key[5::]] += (np.mean(val) / eval_steps)
      self._evaluator.update(predictions, groundtruths)
    metrics = self._evaluator.evaluate()

    # Summary writer writes out eval metrics.
    output_dir = os.path.join(self._model_dir, 'eval')
    tf.gfile.MakeDirs(output_dir)
    summary_writer = tf.summary.FileWriter(output_dir)
    write_summary(metrics, summary_writer, current_step)
    write_summary(losses, summary_writer, current_step)
    summary_writer.close()
    return metrics

  def predict(self, input_fn):
    return self._estimator.predict(input_fn=input_fn)
