lr100
lr100

Reputation: 600

Google Colab TensorBoard in another Chrome Tab

I am going through the PyTorch tutorials and am currently on the TensorBoard one. Through research, I have been able to get it to work inline and through another tab. My preference is to have it persisent in another tab that will update automatically.

The method described below uses ngrok: https://medium.com/@iamsdt/using-tensorboard-in-google-colab-with-pytorch-458f9bb95212

However, it is unstable because it gets to many connections and then drop:

Too many connections! The tunnel session '1Z8HZHdl5gLd1xJVdx5Vqqpl9dW' has violated the rate-limit policy of 20 connections per minute by initiating 133 connections in the last 60 seconds. Please decrease your inbound connection volume or upgrade to a paid plan for additional capacity.

The error encountered was: ERR_NGROK_702

When this happens i have to restart the whole kernal and start over. Very frustrating.

This really isn't the solution I am looking for. Does anyone have a solution for this?

I figured google would have a solution for this.....

Upvotes: 1

Views: 1698

Answers (1)

Chelaru Adrian
Chelaru Adrian

Reputation: 121

Update: Here's an example cell with two buttons to open Tensorboard in another window and hide it on Colab notebook:

%load_ext tensorboard
%tensorboard --logdir="logdir"

import IPython

display(IPython.display.HTML('''
<button id='open_tb'>Open TensorBoard</button> 
<button id='hide_tb'>Hide TensorBoard</button> 
<script>document.querySelector('#open_tb').onclick = () => { window.open(document.querySelector('iframe').src, "__blank") }
        document.querySelector('#hide_tb').onclick = () => { document.querySelector('iframe').style.display = "none" }</script>'''))

You can simple do this by copying the embedded Colab Tensorboard iFrame URL to another Tab. See example here in a gif

Upvotes: 7

Related Questions