How can I run Tensorboard on a remote server?

前端 未结 12 1735
青春惊慌失措
青春惊慌失措 2020-12-12 09:19

I\'m new to Tensorflow and would greatly benefit from some visualizations of what I\'m doing. I understand that Tensorboard is a useful visualization tool, but how do I run

相关标签:
12条回答
  • 2020-12-12 09:46

    For anyone who must use the ssh keys (for a corporate server).

    Just add -i /.ssh/id_rsa at the end.

    $ ssh -N -f -L localhost:8211:localhost:6007 myname@servername -i /.ssh/id_rsa

    0 讨论(0)
  • 2020-12-12 09:47

    --bind_all option is useful.

    $ tensorboard --logdir runs --bind_all
    

    The port will be automatically selected from 6006 incrementally.(6006, 6007, 6008... )

    0 讨论(0)
  • 2020-12-12 09:48

    Another approach is to use a reverse proxy, which allows you to view Tensorboard from any internet connected device without SSHing. This approach can make it far easier / tractable to view Tensorboard on mobile devices, for example.

    Steps:

    1) Download reverse proxy Ngrok on your remote machine hosting Tensorboard. See https://ngrok.com/download for instructions (~5 minute setup).

    2) Run ngrok http 6006 (assuming you're hosting Tensorboard on port 6006)

    3) Save the URL that ngrok outputs:

    4) Enter that into any browser to view TensorBoard:

    Special thanks to Sam Kirkiles

    0 讨论(0)
  • 2020-12-12 09:52
    1. Find your local external IP by googling "whats my ip" or entering this command: wget http://ipinfo.io/ip -qO -
    2. Determine your remote external IP. This is probably what comes after your username when ssh-ing into the remote server. You can also wget http://ipinfo.io/ip -qO - again from there too.
    3. Secure your remote server traffic to just accept your local external IP address
    4. Run Tensorboard. Note the port it defaults to: 6006
    5. Enter your remote external IP address into your browser, followed by the port: 123.123.12.32:6006

    If your remote server is open to traffic from your local IP address, you should be able to see your remote Tensorboard.

    Warning: if all internet traffic can access your system (if you haven't specified a single IP address that can access it), anyone may be able to view your TensorBoard results and runaway with creating SkyNet themselves.

    0 讨论(0)
  • 2020-12-12 09:53

    You don't need to do anything fancy. Just run:

    tensorboard --host 0.0.0.0 <other args here>
    

    and connect with your server url and port. The --host 0.0.0.0 tells tensorflow to listen from connections on all IPv4 addresses on the local machine.

    0 讨论(0)
  • 2020-12-12 09:54

    Here is what I do to avoid the issues of making the remote server accept your local external IP:

    • when I ssh into the machine, I use the option -L to transfer the port 6006 of the remote server into the port 16006 of my machine (for instance): ssh -L 16006:127.0.0.1:6006 olivier@my_server_ip

    What it does is that everything on the port 6006 of the server (in 127.0.0.1:6006) will be forwarded to my machine on the port 16006.


    • You can then launch tensorboard on the remote machine using a standard tensorboard --logdir log with the default 6006port
    • On your local machine, go to http://127.0.0.1:16006 and enjoy your remote TensorBoard.
    0 讨论(0)
提交回复
热议问题