Google Tensorflow 中的事件文件 [英] Event files in Google Tensorflow

查看:18
本文介绍了Google Tensorflow 中的事件文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Tensorflow 构建神经网络,我想在 Tensorboard 上显示训练结果.到目前为止一切正常.但是我有一个关于 Tensorboard 的事件文件"的问题.我注意到每次运行 python 脚本时,它都会生成不同的事件文件.当我运行我的本地服务器时$ python/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/tensorboard.py --logdir=/home/project/tmp/,如果有就显示错误超过 1 个事件文件.这似乎很烦人,因为每当我运行本地服务器时,我都必须删除所有以前的事件文件才能使其工作.所以我想知道是否有任何解决方案可以防止这个问题.我真的很感激.

I am using Tensorflow to build up the Neural Network, and I would like to show training results on the Tensorboard. So far everything works fine. But I have a question on "event file" for the Tensorboard. I notice that every time when I run my python script, it generates different event files. And when I run my local server using $ python /usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/tensorboard.py --logdir=/home/project/tmp/, it shows up error if there are more than 1 event files. It seems to be annoying since whenever I run my local server, I have to delete all previous event files to make it work. So I'm wondering if there is any solution to prevent this issue. I would really appreciate it.

推荐答案

从 TensorBoard 的角度来看,最好的解决方案是为您的实验创建一个根目录,例如~/tensorflow/mnist_experiment,然后为每次运行创建一个新的子目录,例如~/tensorflow/mnist_experiment/run1/...

The best solution from a TensorBoard perspective is to have a root directory for your experiment, e.g. ~/tensorflow/mnist_experiment, and then to create a new subdirectory for each run, e.g. ~/tensorflow/mnist_experiment/run1/...

然后针对根目录运行 TensorBoard,并且每次调用代码时,将 SummaryWriter 设置为指向一个新的子目录.然后,TensorBoard 将正确解释所有事件文件,并且还可以轻松地在不同的运行之间进行比较.

Then run TensorBoard against the root directory, and every time you invoke your code, setup the SummaryWriter pointing to a new subdirectory. TensorBoard will then interpret all of the event files correctly, and it will also make it easy to compare between your different runs.

这篇关于Google Tensorflow 中的事件文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆