Is there any way to use TensorBoard when training a TensorFlow model on Google Colab?
To join @solver149 answer, here is a simple example how to use TensorBoard in google colab
a = tf.constant(3.0, dtype=tf.float32)
b = tf.constant(4.0)
total = a + b
!pip install tensorboardcolab # to install tensorboeadcolab if it does not it not exist
==> Result in my case :
Requirement already satisfied: tensorboardcolab in /usr/local/lib/python3.6/dist-packages (0.0.22)
Fist of all import TensorBoard from tensorboaedcolab (you can use import*
to import everything at once), then create your tensorboeardcolab after that attach a writer to it like this :
from tensorboardcolab import *
tbc = TensorBoardColab() # To create a tensorboardcolab object it will automatically creat a link
writer = tbc.get_writer() # To create a FileWriter
writer.add_graph(tf.get_default_graph()) # add the graph
writer.flush()
==> Result
Using TensorFlow backend.
Wait for 8 seconds...
TensorBoard link:
http://cf426c39.ngrok.io
This example was token from TF guide : TensorBoard.