tensorflow 读取event文件

import tensorflow as tf

# e,即event,代表某一个batch的日志记录
for e in tf.train.summary_iterator('./log/events.out.tfevents.1538814721.7226610225d8'):
    # v,即value,代表这个batch的某个已记录的观测值,loss或者accuracy
    for v in e.summary.value:
        if v.tag == 'loss' or v.tag == 'accuracy':
            print(v.simple_value)
posted @ 2018-10-06 16:57  MrZJ  阅读(4183)  评论(0编辑  收藏  举报