title: How can I read evaluation loss from a tensorboard file?
body: <p>How can I read a tensorboard file programatically and see all scalar values (loss and metrics)? My question is related to <a href="https://stackoverflow.com/questions/41074688/how-do-you-read-tensorboard-files-programmatically">this question on how to read data from tensorboard files</a>.</p>
  
  <p>Following @user1501961's approach and using <code>tensorboard.backend.event_processing.event_accumulator.EventAccumulator</code>, I could read the loss for training. However, I have not figured out the way to see the loss for evaluation. Since the loss for evaluation appears in tensorboard, the data should be somehow buried in the log directory.</p>
  
  <p>Here is part of my script that reads training loss:</p>
  
  <pre><code>In [1]: from tensorboard.backend.event_processing import event_accumulator
  In [2]: ea = event_accumulator.EventAccumulator('PATH_TO_LOGGING_DIR', size_guidance={event_accumulator.SCALARS:0});
  In [3]: ea.Reload();
  In [4]: ea.scalars.Keys()
  Out[4]:
  ['enqueue_input/queue/enqueue_input/random_shuffle_queuefraction_over_250_of_750_full',
   'loss',
   'global_step/sec']
  In [5]: ea.Scalars('loss') # only training loss is read.
  Out[5]: 
  [ScalarEvent(wall_time=1524534430.8867674, step=1, value=0.7076440453529358),
   ScalarEvent(wall_time=1524534523.8320634, step=101, value=0.6497592926025391),
   ScalarEvent(wall_time=1524534554.9782603, step=201, value=0.6366756558418274),
   ScalarEvent(wall_time=1524534586.3355439, step=301, value=0.504106879234314),
  ...
  </code></pre>
  
  <p>I use <code>tf.estimator.train_and_evaluate()</code> to save the loss and other metrics, if that matters.</p>