I have a rather complicated Tensorflow graph that I'd like to visualize for optimization purposes. Is there a function that I can call that will simply save the graph for viewing in Tensorboard without needing to annotate variables?
I Tried this:
merged = tf.merge_all_summaries()
writer = tf.train.SummaryWriter("/Users/Name/Desktop/tf_logs", session.graph_def)
But no output was produced. This is using the 0.6 wheel.
This appears to be related: Graph visualisaton is not showing in tensorboard for seq2seq model
This worked for me:
The graph is loaded automatically when launching tensorboard with "--logdir=logdir/". No "upload" button needed.
You can also dump the graph as a GraphDef protobuf and load that directly in TensorBoard. You can do this without starting a session or running the model.
This will output a file that looks something like this, depending on the specifics of your model.
In TensorBoard you can then use the "Upload" button to load it from disk.
For efficiency, the
tf.train.SummaryWriter
logs asynchronously to disk. To ensure that the graph appears in the log, you must callclose()
orflush()
on the writer before the program exits.For all clarity, this is how I used the
.flush()
method and resolved the issue:Initialize the writer with:
and use the writer with: