首页 > 解决方案 > Trying to show graph and other details in TensorBoard on google-colab by ngrok but failed

问题描述

I trained a model, got a log file and show graph and other details in TensorBoard on my computer. It was successful and nothing wrong.

Then I tried to do it again on colab. I install ngrok and tensorboard on colab, upload the log file and call tensorboard to show information.


# Install tensorboardcolab,download and unzeip ngrok
!pip install tensorboardcolab
!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
!unzip ngrok-stable-linux-amd64.zip
print()

# Delete unuse file and folder
!rm ngrok-stable-linux-amd64.zip
!rm -f -r sample_data
!pwd
!ls
print()
# upload a log file from local
from google.colab import files
uploaded = files.upload()
!ls
print()

# start tensorboard on ngrok
get_ipython().system_raw('tensorboard --logdir /content --host 0.0.0.0 --port 6006 &')
get_ipython().system_raw('./ngrok http 6006 &')
!curl -s http://localhost:4040/api/tunnels | python3 -c \
    "import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])"

Below is the output after I ran the above.

Requirement already satisfied: tensorboardcolab in /usr/local/lib/python3.6/dist-packages (0.0.22)
--2019-06-17 08:01:48--  https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
Resolving bin.equinox.io (bin.equinox.io)... 52.72.145.109, 52.203.66.95, 52.200.123.104, ...
Connecting to bin.equinox.io (bin.equinox.io)|52.72.145.109|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16648024 (16M) [application/octet-stream]
Saving to: ‘ngrok-stable-linux-amd64.zip’

ngrok-stable-linux- 100%[===================>]  15.88M  17.0MB/s    in 0.9s    

2019-06-17 08:01:49 (17.0 MB/s) - ‘ngrok-stable-linux-amd64.zip’ saved [16648024/16648024]

Archive:  ngrok-stable-linux-amd64.zip
  inflating: ngrok                   

/content
ngrok


events.out.tfevents.1560697268.DESKTOP-SMMCEHS(n/a) - 3431006 bytes, last modified: 6/16/2019 - 100% done
 Saving events.out.tfevents.1560697268.DESKTOP-SMMCEHS to events.out.tfevents.1560697268.DESKTOP-SMMCEHS
events.out.tfevents.1560697268.DESKTOP-SMMCEHS  ngrok

http://c9c33cc9.ngrok.io

I got this in the link. It said "No dashboards are active for the current data set".

Here is the notebook on colab.

I have no idea why this happened. There is a valid tensorboard link so I guess ngrok worked fine. Checked TensorBoard tutorial but it focus on how to use in a local environment.

Can anyone help me with this? Any reply would be greatly appreciated.

标签: pythonpython-3.xgoogle-colaboratorytensorboard

解决方案


推荐阅读