通过【端口转发】在服务器上使用TensorBoard


如果是一次转发:

https://stackoverflow.com/questions/37987839/how-can-i-run-tensorboard-on-a-remote-server



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.


如果是多次(两次)转发,现在用跳板机的情况很普遍:

道理一样,就是设置几次级联转发。

比如我们想实现【本地16006 ==》跳板机16007 ==》目标服务器6006】,则:

1)【本地16006 ==》跳板机16007】ssh -L 16006:127.0.0.1:16007 oliver@162.105.*.*

2)【跳板机16007 ==》目标服务器6006】ssh -L 16007:127.0.0.1:6006 oliver@10.0.0.1

3)然后再目标服务器上运行自己的代码:python test.py

4)然后启动tensorboard:tensorboard --logdir results

5)然后去本地16006端口看tensorboard可视化结果:http://127.0.0.1:16006/



下面这个写的更详细。。。

https://blog.mobatek.net/post/ssh-tunnels-and-port-forwarding/


©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页