Introduction to TensorFlow for Developers. Part 2/?: Tensorboard and colab

piotr szybicki
12 developer labors
2 min readMay 15, 2018

--

Part 1: Introduction.

In this part and it will be very short we will cover the tensorboard. It is a tool that has many features but we are going to take a look at one in particular. I mentioned in the previous post that before we can execute any calculation we have to construct the computation graph. For now our,just by looking at the code, we can easyly understand what is goin on. But as soon as we go into deep learning things won’t be so easy. We need a tool to visualize. That tool is tensorbard. Running TensorBoard inside colab is a bit tricky as it is a VM that is running in the cloud. But we can manage.

The above code is mostly a copy from the previus post. But thera are some addtions first there is an installation and inport of the pacakge called: tensorboardcolab I used it to connect to the tasorboard application that we are lunching when invoking

tbc=TensorBoardColab().

It will print us a link we can click on it, new tab will open with the tensorboard app will tell us that there is nothing to show yet. In order to save our model to disk we have to add our session graph to the writer:

train_writer.add_graph(sess.graph)

Now we can run the code and after it finishes we can hit refresh on the tab where the tensorboard opened. It should display our computation graph. Screen below. As you can see it is a single execution path that goes from the input to the reshape to the multiplication and to the reshape again and outputs a result. You can notice the arrows it is a direction of the data flow.

The last think to notice it that some of the tensorflow operations in the code have the parameter name added. It is just to make it easy in tensorboard to identify nodes.

--

--

piotr szybicki
12 developer labors

Piotr Szybicki’s, Programmer, Java Developer, ML Entusiast