Event files in Google Tensorflow

2019-07-19 01:24发布

问题:

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.

回答1:

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/...

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.