30

I am following google cloud machine learning tutorial and I am unable to Launch TensorBoard

I've followed the steps in the above tutorial (also set up my environment using docker container) until typing the below command in the terminal

tensorboard --logdir=data/ --port=8080

Where the terminal outputs the below prompt

Starting TensorBoard 29 on port 8080
(You can navigate to http://172.17.0.2:8080)

When I visit http://172.17.0.2:8080 in my browser I see nothing (the server where this page is located is not responding).

Can someone please advice how I can launch Tensor Board ?

SpaceX
  • 2,814
  • 2
  • 42
  • 68
  • This looks like a firewall issue. Is the port 8080 open on your server? – Thomas Moreau Oct 18 '16 at 11:36
  • How do I check ? When I try to ping `http://172.17.0.2:8080` I get `ping: cannot resolve http://172.17.0.2:8080: Unknown host` – SpaceX Oct 18 '16 at 11:47
  • http://askubuntu.com/questions/538208/how-to-check-opened-closed-port-on-my-computer – Thomas Moreau Oct 18 '16 at 11:53
  • Thanks for the tip, tried all the commands in the link (`netstat -l / -a / -t / -u / -n`), but could not find the port number 8080 in any of the terminal outputs. – SpaceX Oct 18 '16 at 12:16
  • You can use this to open a port: http://stackoverflow.com/questions/21065922/how-to-open-a-specific-port-such-as-9090-in-google-compute-engine – Thomas Moreau Oct 18 '16 at 12:17
  • Or, if you tagged your machine as a `http-server` during the creation of the machine, you could also just start tensorboard on port 80: `tensorboard --logdir=data/ --port=80`. – Fematich Oct 18 '16 at 14:30

10 Answers10

93

Had the same problem this morning. Solved it with

tensorboard --logdir=data/ --host localhost --port 8088

Navigated the browser to http://localhost:8088

rodrigo-silveira
  • 12,607
  • 11
  • 69
  • 123
13

Try

tensorboard --logdir=d:/data --host 0.0.0.0

This will open socket listening to all network interfaces, so you can connect from local host (same pc) or from the local network(from pc/mobile in network).

Mendi Barel
  • 3,350
  • 1
  • 23
  • 24
8

I faced the same problem when used Tensorboard inside a Docker container. The successful steps in my case were:

  1. First of all, make sure the port you use for Tensorboard is opened to the outside world. To make this possible run your Docker container with an option -p <host_machine_port>:<tensorboard_port_inside_container>. For example:

docker run --name my_tensorboard_container -p 7777:8080 my_tensorboard_image bash

  1. Then if you still cannot access the Tensorboard try to add --bind_all option like so:

tensorboard --bind_all --port 8080 --logdir ./logs

Hope, it works in your case as well.

VladVin
  • 633
  • 6
  • 13
3

It looks like the port 8080 is not open on your machine.
You can check it with this command line tool: netstat -a.

To open a specific port on google cloud platform, see this answer from SO.

Community
  • 1
  • 1
Thomas Moreau
  • 4,377
  • 1
  • 20
  • 32
2

If you are using Google Cloud Shell you have to click on icon placed in upper left of shell window.

Osoter
  • 571
  • 3
  • 9
  • Could you please specify this a bit more? I am using JupyterLab on Google Cloud Platform (GCP) and I somehow don't manage to open TensorBoard there.. Thanks! :-) –  Dec 26 '20 at 08:11
2

There are 2 solutions(as far as i could check) to solve this problem:

  1. Instead of using the http://name:port_number, use http://localhost:port_number. This is if you are using Chrome browser.

  2. If you are using firefox(recommended as it's really convenient), then you can open the link(which has your PC name) directly, which is displayed after executing the "tensorboard --logdir=logs/" command in cmd, i.e; http://name:port_number will work here.

(name here refers to the PC or user name)

VinjaNinja
  • 59
  • 7
1

I don't know if that's the case, but tensorboard has some visualization problems in several browsers. Try to connect to http://172.17.0.2:8080 with a different browser (for example, on my macbook, safari doesn't work very well with tensorboard and I use google Chrome).

Gabriele
  • 11
  • 4
1

as stated by 'rodrigo-silveira'

tensorboard --logdir=data/ --host localhost --port 8088

this works for me as well. just change the name of graph directory. here the directory is data/

writer = tf.summary.FileWriter( 'logs', sess.graph )

here, the directory is logs, so when I typed below command in cmd, below window appeared.

tensorboard --logdir=data/ --host localhost --port 8088

this is the window pop up

Sangam Belose
  • 4,262
  • 8
  • 26
  • 48
1

you have to change port to the tensorboard port in the right toolbar in Gloud shell

enter image description here

HimalayanCoder
  • 9,630
  • 6
  • 59
  • 60
0

In my case, the port was not open. Opening the port, helped me. This process was done on Linux.

Here is what I did:

First I checked if the port is open or not.

netstat -tulpn

You can check it by above code.

Then open the port by following code. Just change the port number in place of 8080

sudo /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

sudo iptables-save

This should solve the issue.