本文介绍了TensorFlow - 从 TensorBoard TFEvent 文件导入数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 TensorFlow 中使用不同的图表进行了多次训练.我设置的摘要在训练和验证中显示了有趣的结果.现在,我想获取我保存在摘要日志中的数据并执行一些统计分析和一般绘图,并以不同的方式查看摘要数据.是否有任何现有方法可以轻松访问这些数据?

I've run several training sessions with different graphs in TensorFlow. The summaries I set up show interesting results in the training and validation. Now, I'd like to take the data I've saved in the summary logs and perform some statistical analysis and in general plot and look at the summary data in different ways. Is there any existing way to easily access this data?

更具体地说,是否有任何内置方法可以将 TFEvent 记录读回 Python?

More specifically, is there any built in way to read a TFEvent record back into Python?

如果没有简单的方法可以做到这一点,TensorFlow 声明其所有文件格式都是 protobuf 文件.根据我对 protobufs 的理解(这是有限的),我想如果我有 TFEvent 协议规范,我就可以提取这些数据.有没有简单的方法来了解这个?非常感谢.

If there is no simple way to do this, TensorFlow states that all its file formats are protobuf files. From my understanding of protobufs (which is limited), I think I'd be able to extract this data if I have the TFEvent protocol specification. Is there an easy way to get ahold of this? Thank you much.

推荐答案

正如 Fabrizio 所说,TensorBoard 是一个很棒的工具用于可视化摘要日志的内容.但是,如果您想执行自定义分析,则可以使用 tf.train.summary_iterator() 函数来循环所有 tf.Eventtf.Summary 日志中的协议缓冲区:

As Fabrizio says, TensorBoard is a great tool for visualizing the contents of your summary logs. However, if you want to perform a custom analysis, you can use tf.train.summary_iterator() function to loop over all of the tf.Event and tf.Summary protocol buffers in the log:

for summary in tf.train.summary_iterator("/path/to/log/file"):
    # Perform custom processing in here.

tf2 更新:

from tensorflow.python.summary.summary_iterator import summary_iterator

您需要导入它,默认情况下当前未导入该模块级别.在 2.0.0-rc2 上

You need to import it, that module level is not currently imported by default. On 2.0.0-rc2

这篇关于TensorFlow - 从 TensorBoard TFEvent 文件导入数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 02:46