使用localhost访问远程tensorboard

场景与问题

tensorflow程序运行在远程服务器,tensorboard启动后访问地址为:0.0.0.0:6006。这样没法用自己机器上的浏览器访问tensorboard。

解决办法

1 . 连接ssh时,将服务器的6006端口重定向到自己机器上来:

ssh -L 16006:127.0.0.1:6006 username@remote_server_ip
  • 1

其中:16006:127.0.0.1代表自己机器上的16006号端口,6006是服务器上tensorboard使用的端口。

2 . 在服务器上使用6006端口正常启动tensorboard:

tensorboard --logdir=xxx --port=6006
  • 1

3 . 在本地浏览器中输入地址:

127.0.0.1:16006
  • 1

Reference

猜你喜欢

转载自blog.csdn.net/qq_34009929/article/details/80166324