aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/examples/tutorials
diff options
context:
space:
mode:
authorGravatar Mark Daoust <markdaoust@google.com>2017-06-28 05:22:43 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-06-28 05:26:03 -0700
commitab4f01025175f98970e0d391ef1c45e818ac443d (patch)
tree0a76ec012997b268194bfa284c54fb2d5d2a6a58 /tensorflow/examples/tutorials
parentd22c05a81a26e930655c9c5b1be3e0c235edfdcc (diff)
In `mnist_deep.py` Write out the graph for tensorboard.
Add a screenshot of the tensorboard diagram to the tutorial page. Fixes: #3044 PiperOrigin-RevId: 160397248
Diffstat (limited to 'tensorflow/examples/tutorials')
-rw-r--r--tensorflow/examples/tutorials/mnist/mnist_deep.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/examples/tutorials/mnist/mnist_deep.py b/tensorflow/examples/tutorials/mnist/mnist_deep.py
index 4df925c1f3..4b5b50400a 100644
--- a/tensorflow/examples/tutorials/mnist/mnist_deep.py
+++ b/tensorflow/examples/tutorials/mnist/mnist_deep.py
@@ -28,6 +28,7 @@ from __future__ import print_function
import argparse
import sys
+import tempfile
from tensorflow.examples.tutorials.mnist import input_data
@@ -148,6 +149,11 @@ def main(_):
correct_prediction = tf.cast(correct_prediction, tf.float32)
accuracy = tf.reduce_mean(correct_prediction)
+ graph_location = tempfile.mkdtemp()
+ print('Saving graph to: %s' % graph_location)
+ train_writer = tf.summary.FileWriter(graph_location)
+ train_writer.add_graph(tf.get_default_graph())
+
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for i in range(20000):