How to export tensor board data?

余生颓废 提交于 2019-12-04 23:43:21

问题


In the tensorborad's README.md, it ask me to do like this:

How can I export data from TensorBoard?

If you'd like to export data to visualize elsewhere (e.g. iPython Notebook), that's possible too. You can directly depend on the underlying classes that TensorBoard uses for loading data: python/summary/event_accumulator.py (for loading data from a single run) or python/summary/event_multiplexer.py (for loading data from multiple runs, and keeping it organized). These classes load groups of event files, discard data that was "orphaned" by TensorFlow crashes, and organize the data by tag.

And I do it as what it sayid with the mnist example in tensorflow. But I can't get any event from the original data whereas it shows on the tensorboard normally.

below is my code:

x = EventAccumulator(path="/tmp/tensorflow/mnist/logs/mnist_with_summaries/")
x.Reload()
print(x.Tags())
x.FirstEventTimestamp()
print(x.Tags())

And the result showed like below:

{'scalars': [], 'histograms': [], 'run_metadata': [], 'images': [], 'graph': False, 'audio': [], 'meta_graph': False, 'compressedHistograms': []}

I can't get any tag or event from the original data. However, when I open the tensorboard. Everything just look fine.


回答1:


According to the docs for EventAccumulator a path arg is a file path to a directory containing tf events files, or a single tf events file. So in your case you should instantiate EventAccumulator instance with:

x = EventAccumulator(path="/tmp/tensorflow/mnist/logs/mnist_with_summaries/train")

or

x = EventAccumulator(path="/tmp/tensorflow/mnist/logs/mnist_with_summaries/test")


来源:https://stackoverflow.com/questions/41082908/how-to-export-tensor-board-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!