在 tensorborad 的 README.md 中,它要求我这样做:
如何从 TensorBoard 导出数据?
如果您想导出数据以在其他地方可视化(例如 iPython Notebook),
那也是可能的。您可以直接依赖于底层类
TensorBoard 用于加载数据:python/summary/event_accumulator.py
(用于
从单次运行中加载数据)或 python/summary/event_multiplexer.py
(对于
从多次运行中加载数据,并保持其组织性)。这些类加载
事件文件组,丢弃因 TensorFlow 崩溃而“孤立”的数据,
并按标签组织数据。
我按照它在 tensorflow 中的 mnist 示例中所说的那样进行操作。 但是我无法从原始数据中获取任何事件,而它正常显示在张量板上。
下面是我的代码:
x = EventAccumulator(path="/tmp/tensorflow/mnist/logs/mnist_with_summaries/")
x.Reload()
print(x.Tags())
x.FirstEventTimestamp()
print(x.Tags())
结果如下:
{'标量':[],'直方图':[],'run_metadata':[],'图像':[],'图形':假,'音频':[],'元图': False, 'compressedHistograms': []}
我无法从原始数据中获取任何标记或事件。但是,当我打开张量板时。一切看起来都很好。
最佳答案
根据 EventAccumulator
的文档,path
arg 是指向包含 tf 事件文件或单个 tf 事件文件的目录的文件路径。
因此,在您的情况下,您应该实例化 EventAccumulator
实例:
x = EventAccumulator(path="/tmp/tensorflow/mnist/logs/mnist_with_summaries/train")
或
x = EventAccumulator(path="/tmp/tensorflow/mnist/logs/mnist_with_summaries/test")
关于python - 如何导出张量板数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41082908/