14

Using my own laptop to run Tensorflow on remote server of lab

I used tensorboard --logdir=./log try to view curves of the running results

I got:

 Starting TensorBoard  on port 6006
(You can navigate to http://0.0.0.0:6006)

and then I tried to connect it in the browser, but it failed...

anyone know how to configure in order to view tensorboard of remote server on my own laptop?

Xuchen Liu
  • 141
  • 1
  • 1
  • 3
  • Try following the suggestions here: https://www.quora.com/I-made-a-website-and-can-access-it-on-my-computer-on-localhost-Can-I-access-the-same-website-on-another-computer-connected-with-LAN-with-my-computer – Shan Carter Jul 19 '16 at 19:29
  • Possible duplicate of [How can I run Tensorboard on a remote server?](http://stackoverflow.com/questions/37987839/how-can-i-run-tensorboard-on-a-remote-server) – ccy Apr 18 '17 at 02:47
  • There is an answer to this question by Olivier Mondroit here, [How can I run Tensorboard on a remote server?](https://stackoverflow.com/a/40413202/1644508) – Nathan Crock Aug 08 '17 at 01:49

5 Answers5

22

If you start the tensorboard server on your lab instance using the command you mentioned, it will be running on the lab server and hosting the tensorboard webpage from labserverIP:6006.

I use a cluster running SLURM (which manages everyone's job submissions) and am able to start the tensorboard server on cluster node and then SSH into the specific node running the tensorboard server and essentially forward the site from from the labserverIP:6006 to my laptop at localhost:6006. My script on github here shows the commands I use to do this for SLURM. Essentially it is these three steps:

1) Start the remote server and run tensorboard --logdir=./log --host $SERVER_IP --port $SERVER_PORT

2) SSH from your laptop using ssh uname@login.node.edu -L $LOCAL_PORT:$SERVER_IP:$SERVER_PORT

You can replace uname@login.node.edu with the server public IP.

3) Got to http://localhost:$LOCAL_PORT in your laptop's browser to access the tensorboard page.

The other option is to copy all of the log files to your local machine or a shared drive and then start tensorboard on your laptop with the local or shared directory as your logdir.

jperezmartin
  • 407
  • 4
  • 19
Taylor Paul
  • 364
  • 2
  • 9
9

This is how I can forward a port at remote server to my local home computer

ssh -NfL 6006:localhost:6006 username@remote_server_address

Dat
  • 5,405
  • 2
  • 31
  • 32
4

If you are able to SSH into your lab instance from your laptop using a public IP, regardless of the message shown, you could use http://<publicIP>:6006 to view TensorBoard.

Else if there is no public IP associated with the lab machine server, you could try to forward port 6006 while SSH-ing into your lab machine. Please refer OpenSSH port forwarding manual for the same.

Mathias Müller
  • 22,203
  • 13
  • 58
  • 75
Arun Das
  • 333
  • 3
  • 11
2

This is how we solved it (Linux SLURM server)

  1. ssh to your server and find its IP via terminal by running: IP=`hostname -I`
  2. Open the tensorboard server on the host server:

python -m tensorboard.main --logdir=/your/dir --host $IP

  1. Use your browser to and surf to http://$IP:6006
Mano
  • 797
  • 3
  • 17
2

You can use following option

tensorboard --logdir logs --bind_all

Then, copy and paste the link to your local browser

Ashiq Imran
  • 2,077
  • 19
  • 17