question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error using TensorBoard in a Jupyter Notebook on the Google Cloud Platform

See original GitHub issue

I followed instructions to launch TensorBoard like this:

`get_ipython().system_raw( “tensorboard --logdir {} --host 0.0.0.0 --port 6006 &” .format(OUTDIR) )

get_ipython().system_raw(“./assets/ngrok http 6006 &”)

!curl -s http://localhost:4040/api/tunnels | python3 -c
“import sys, json; print(json.load(sys.stdin)[‘tunnels’][0][‘public_url’])” `

The following error messages show up:

Traceback (most recent call last): File “”, line 1, in File “/usr/lib/python3.5/json/init.py”, line 268, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File “/usr/lib/python3.5/json/init.py”, line 319, in loads return _default_decoder.decode(s) File “/usr/lib/python3.5/json/decoder.py”, line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File “/usr/lib/python3.5/json/decoder.py”, line 357, in raw_decode raise JSONDecodeError(“Expecting value”, s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Before running this code, I had already trained a Tensorflow model and exported it to the directory “OUTDIR”. The tunnel connection is not set up and therefore no public URL is generated.

Can anyone kindly give me some advice as to how to solve it? Thank you very much!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:29 (1 by maintainers)

github_iconTop GitHub Comments

25reactions
vlasenkoalexeycommented, Jul 23, 2020

I think the easiest way to workaround this is to run tensorboard in a JupyterLab console: tensorboard --port=7000 --logdir logs

And then setup port forwarding using gcloud command: gcloud beta compute ssh --zone “{your zone}” “{your instance name}” --project “{your project name}” – -L 7000:localhost:7000

You can copy this command for your VM from gcloud console VM instance details page, click SSH drop down and select ‘view gcloud command’. Then just add port you want to forward as – -L 7000:localhost:7000

After this you should be able to access tensorboard running on your cloud VM as localhost:7000

15reactions
tarradecommented, Mar 18, 2020

Same issue using GCP AI Platform notebook (TF 2.1 image) image

I was told by the GCP AI Platform notebook team that this scenario is not supported because TensorBoard widget is trying to do port forwarding under the hood and the AI Platform notebook proxy prevents it from connecting to non-HTTPS ports.

  1. Is there a tricks to run in another way to avoid this issue (even if TensorBoard in not running in a jupyter cell
  2. Is there a plan to be able to have TensorBoard running on GCP AI Platform notebook ? I think this will be great for data scientist working on GCP and it is also use in GCP ML training
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using TensorBoard in Notebooks - TensorFlow
TensorBoard can be used directly within notebook experiences such as Colab and Jupyter. This can be helpful for sharing results, ...
Read more >
Cannot run TensorBoard in Google Cloud JupyterLab instance
It seems that after TensorFlow 2.0 released, TensorBoard cannot be opened in Google Cloud JupyterLab. When I use Create new TensorBoard ...
Read more >
Get started with Vertex AI TensorBoard - Google Cloud
Use the Google Cloud console. You can view your Vertex AI TensorBoard experiment from the Google Cloud console with the following steps. In...
Read more >
Machine Learning with TensorFlow in Vertex AI
In this lab you will learn how to use Google Cloud Machine Learning ... instance on which you devlop a TensorFlow model in...
Read more >
Getting Started with Cloud TPUs - | notebook.community
This notebook requires that you run it on a GCE VM in a GCP project that has Cloud TPU quota. If you are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found