Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write summaries for multiple runs in Tensorflow

Tags:

If you look at the Tensorboard dashboard for the cifar10 demo, it shows data for multiple runs. I am having trouble finding a good example showing how to set the graph up to output data in this fashion. I am currently doing something similar to this, but it seems to be combining data from runs and whenever a new run starts I see the warning on the console:

WARNING:root:Found more than one graph event per run.Overwritting the graph with the newest event

like image 905
kldavis4 Avatar asked Dec 31 '15 22:12

kldavis4


People also ask

What is TensorFlow summary?

The tf. summary module provides APIs for writing summary data. This data can be visualized in TensorBoard, the visualization toolkit that comes with TensorFlow. See the TensorBoard website for more detailed tutorials about how to use these APIs, or some quick examples below.

What is Tensorboardx?

TensorBoard is a visualization toolkit for machine learning experimentation. TensorBoard allows tracking and visualizing metrics such as loss and accuracy, visualizing the model graph, viewing histograms, displaying images and much more.

How do you visualize a TensorFlow model?

TensorBoard's Graphs dashboard is a powerful tool for examining your TensorFlow model. You can quickly view a conceptual graph of your model's structure and ensure it matches your intended design. You can also view a op-level graph to understand how TensorFlow understands your program.

Can we check metadata of model in TensorBoard?

Overview. Using the TensorFlow Text Summary API, you can easily log arbitrary text and view it in TensorBoard. This can be extremely helpful to sample and examine your input data, or to record execution metadata or generated text.


1 Answers

The solution turned out to be simple (and probably a bit obvious), but I'll answer anyway. The writer is instantiated like this:

writer = tf.train.SummaryWriter(FLAGS.log_dir, sess.graph_def)

The events for the current run are written to the specified directory. Instead of having a fixed value for the logdir parameter, just set a variable that gets updated for each run and use that as the name of a sub-directory inside the log directory:

writer = tf.train.SummaryWriter('%s/%s' % (FLAGS.log_dir, run_var), sess.graph_def)

Then just specify the root log_dir location when starting tensorboard via the --logdir parameter.

like image 171
kldavis4 Avatar answered Sep 28 '22 21:09

kldavis4