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