解析在tensorflow摘要对象上计算的`summary_str`字节字符串

目前tensorflow是tensorboard is not compatible with python3.因此,一般来说,我正在寻找一种在100个时期内打印出摘要读数的方法.

是否有一个函数将以下行中生成的summary_str字节字符串解析为浮点字典?

summary_op = tf.merge_all_summaries()
summary_str = sess.run(summary_op, feed_dict=feed_dict)
您可以通过将summary_str解析为tf.Summary协议缓冲区来获取summary_str的文本表示,如下所示:

summary_proto = tf.Summary()
summary_proto.ParseFromString(summary_str)
print(summary_proto)

然后,您可以将其转换为字典映射字符串标记到浮点数:

summaries = {}
for val in summary_proto.value:
    # Assuming all summaries are scalars.
    summaries[val.tag] = val.simple_value
https://stackoverflow.com/questions/34568675/parsing-summary-str-byte-string-evaluated-on-tensorflow-summary-object

转载注明原文:解析在tensorflow摘要对象上计算的`summary_str`字节字符串