Using tensorboard in colab

Hello!
I am using colab.
I was following the tutorial using colab notebook
https://pytorch.org/tutorials/intermediate/tensorboard_tutorial.html
when I reached to the line
tensorboard --logdir=runs
I got the error
" File “”, line 1
tensorboard --logdir= runs
^
SyntaxError: can’t assign to operator"

Changed it to “!tensorboard --logdir=runs”
I got
“Serving TensorBoard on localhost; to expose to the network, use a proxy or pass --bind_all
TensorBoard 2.1.0 at http://localhost:6007/ (Press CTRL+C to quit)”
pressing the link got " This site can’t be reached"
In short how can I run this code in colab?
Thanks!

Hi,

From googling, there seems to be an extension to use tensorboard on colab.
You can do in a new cell:

%load_ext tensorboard
%tensorboard --logdir mylogdir

And that will launch tensorboard with the given logdir :slight_smile:

Ok thanks !
I already found a solution and now my model going to finish training
this could be helpful for someone in the future
https://medium.com/looka-engineering/how-to-use-tensorboard-with-pytorch-in-google-colab-1f76a938bc34
sorry for asking before trying!

1 Like