Error using TensorBoard in a Jupyter Notebook on the Google Cloud Platform
See original GitHub issueI 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:
- Created 4 years ago
- Reactions:1
- Comments:29 (1 by maintainers)
Top GitHub Comments
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
Same issue using GCP AI Platform notebook (TF 2.1 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.