无法在 Azure 虚拟机上访问 TensorBoard

TensorBoard unreachable on Azure virtual machine

我在 Azure 上的 Ubuntu 16.04 虚拟机上进行了 TensorFlow 模型训练。突然之间,TensorBoard 进程无法再从外部访问。网络安全组应该配置正确(见图片),正如我所说,它一直工作到今天晚上。我没有改变机器上的任何东西。我可以做任何支票吗?有什么提示吗?谢谢!

你应该使用 netstat -ant|grep 6006(TensorFlow 默认监听 6006)。您应该得到以下结果。

shui@shui:~$ netstat -ant|grep 6006
tcp        0      0 0.0.0.0:6006            0.0.0.0:*               LISTEN     

根据你的描述,我认为端口没有在监听。当你启动一个tensorflow服务时,如果你只使用tensorboard --logdir=run1:/tmp/tensorflow/。当 ssh 会话过期或关闭时,服务将停止,您将无法连接 tensoforflow 服务。您可以使用以下命令启动服务。即使您的 ssh 会话已过期或关闭,您也可以访问您的服务。

nohup tensorboard --logdir=run1:/tmp/tensorflow/ &

man nohup

nohup - run a command immune to hangups, with output to a non-tty

& to the command line to run in the background:

替代 nohup,您可以在 screen 会话中实现类似的结果 运行 张量板:

:~$ screen -S tensorboard-screen
:~$ tensorboard --logdir=run1:/tmp/tensorflow/

然后键入 Ctrl + a, d 以分离屏幕并返回主屏幕 shell。当您退出 ssh 会话时,屏幕将 运行 亮起。重新登录后,只需键入 screen -r tensroboard-screen 即可恢复屏幕会话。

如果您只是设置一个 VM 然后尝试 运行 tensorboard 它不会工作,因为您需要添加入站端口规则。您可以按照 this 博客 post 正确设置端口。

应用更改可能需要几分钟时间。 Tensorboard 一直说它收到了一个错误的请求,在更改规则并立即尝试访问 tensorboard 后说错误的请求。