Skip to content

Instantly share code, notes, and snippets.

@motokimura
Last active November 19, 2019 02:33
Show Gist options
  • Save motokimura/66f352d12b88dcacf97b1a9ed198666a to your computer and use it in GitHub Desktop.
Save motokimura/66f352d12b88dcacf97b1a9ed198666a to your computer and use it in GitHub Desktop.
import tensorflow as tf
def _get_values_from_tb(tb_file, key='val/aP50', values={}):
sess = tf.InteractiveSession()
with sess.as_default():
for e in tf.train.summary_iterator(tb_file):
for v in e.summary.value:
if v.tag == key:
values[e.step] = v.simple_value
return values
def _get_values_from_tb_files(tb_files, key='val/aP50'):
values = {}
for tb_file in tb_files:
values = _get_values_from_tb(tb_file, key=key, values=values)
return values
def parse_tb_files(tb_files):
ret = {}
for key in ['val/aP50', 'val/aP75', 'val/aP5095', 'val/aP5095_S', 'val/aP5095_M', 'val/aP5095_L']:
ret[key] = _get_values_from_tb_files(tb_files, key=key)
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment