Visualising a graph on Tensorboard

When you are training massive neural networks, it becomes necessary to have a debugger. You might want to use many optimisation tricks, to decrease the size of your model or maybe want to optimize your model for inference on some platform. There are tons of other modifications you might want to try, to get your model ready for your target devices. You can use TensorBoard to visualize your TensorFlow graph.

If you are looking for a quick overview of your model, make use of “summarize” tool in tensorflow. (Make sure, you have Bazel and Tensorflow installed on your machine)

bazel build tensorflow/tools/graph_transforms:summarize_graph
bazel-bin/tensorflow/tools/graph_transforms/summarize_graph - in_graph= /Users/…../Documents/20181105–043303/frozen_graph.pb - print_structure=true

This blog is about quickly analysing your .pb (Protocol Buffer model) model/graph on tensorboard.

If you have successfully re-trained any model using tensorflow, you will be noticing that there are many files that are generated at the end of the training process, following are the files..

model-20181105–043303.meta
model-20181105–043303.ckpt-8.index
model-20181105–043303.ckpt-8.data-00000-of-00001
checkpoint

Along with the files above, you must be able to find the following files, which are generated along with every checkpoint file.

events.out.tfevents.1541643520.2e7c48f19ec9

If you can see these files, then you are good to go..

  1. Clone tensorboard repo from github.
  2. Build tensorboard and pass the folder containing the events/logs files like above.
bazel build tensorboard:tensorboard
./bazel-bin/tensorboard/tensorboard --logdir path/to/logs

Following is the output you should see after executing the command above.
TensorBoard 1.13.0a0 at http://.....-MacBook-Pro.local:6006 (Press CTRL+C to quit)
time_save_variables

There you go, you must no be able to see your tensorflow graph on your browzer.