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)

猜你喜欢

转载自www.cnblogs.com/MrZJ/p/9747758.html