2

How can see the graph, generated by TensorFlow using Tensorboard? Can anyone provide a simple example? I am very new to tensorflow. I am using python as well.

Thanks in advance!!

2 Answers 2

2

You need to create a tf.summary.FileWriter that writes your graph to a TensorBoard log. For instance:

summary_writer = tf.summary.FileWriter('logs', graph=tf.get_default_graph())
summary_writer.flush()

And then launch tensorboard with the appropriate --logdir parameter.

Sign up to request clarification or add additional context in comments.

1 Comment

and then open the browser at localhost:6006 and click on the graph tab :)
0

First of all you need to create your computational graph

import tensorflow as tf

a = tf.constant(3)
b = tf.constant(4)

c = a+b

with tf.Session() as sess:
    File_Writer = tf.summary.FileWriter('/home/theredcap/Documents/CS/Personal/Projects/Test/tensorflow/tensorboard/' , sess.graph )
    print(sess.run(c))

Here the tf.summary.FileWriter(' path to store your logs')writes the graph to the Tensorflow log

Then all you have to do is access the tensorboard with the mentioned log/graph that you just wrote with

tensorboard --logdir "path/to/logs"

Note: When I did

tensorboard --logdir = "the above mentioned path"

Nothing was displayed on my tensorboard

For more info

https://github.com/tensorflow/tensorboard/blob/master/README.md

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.