Tensorflow and Tensor Board – working together

This article give you how you can write your tensorflow program and enable tensorboard together with it to analyze tensor graph and other components i.e. scalers, images, audio etc..

If you are new to tensorflow, your can learn about tensorflow here… And if you want to know “What is tensorboard”, best look at here

How to facilitate it:

  1. Define your tensorflow placeholder, variables, etc
  2. Defined session and Run session first
    1. Note: See following example on how to do it.
  3. Define the tensorboard summary fileWriter and graph in specificd dir as below:
    1. writer = tf.summary.FileWriter(“/tmp/test-tf”, sess.graph)
    2. tf.train.write_graph(sess.graph_def, ‘/tmp/test-tf’, ‘graph.pbtxt’)
  4. Start tensorboard as below:

    $ tensorboard –logdir /tmp/test-tf/

  5. Check your folder for events and graph logs:
    • $ ll /tmp/test-tf/
    • -rw-rw-r– 1 ubuntu ubuntu 23565 Dec 11 19:45 events.out.tfevents.1481485540.ip-10-236-190-133
    • -rw-rw-r– 1 ubuntu ubuntu 24354 Dec 11 19:45 graph.pbtxt

Follow is an example of jupyter notebook:

https://github.com/Avkash/mldl/blob/master/notebook/TF%2Bwith%2Btensorboard%2Bexample.ipynb

Here is an screenshot of tensorboard and graph:

screen-shot-2017-01-04-at-9-48-39-pm

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s