我正在远程ec2实例上运行Jupyter Notebook。在培训过程完成后,将jupyter笔记本计算机隧道连接到我的本地计算机的连接失败。这意味着自动保存也失败。但是,我的机器和远程实例之间的连接仍在运行。因此,我进行了检查,最后一次保存jupyter笔记本是在它开始训练之前。我知道我可以退出连接并再次打开它,但是我担心会丢失笔记本中的信息。我该怎么做才能防止这种情况?
我前一段时间通过ssh建立了连接:
ssh -i my-key.pem ubuntu@the-ip-to-my-instance
然后我通过$jupyter notebook --no-browser --port 8888
在远程服务器上运行jupyter笔记本,并使用ssh -NL 8888:localhost:8888 ec2
连接到本地计算机上,其中ec
是包含实例凭据的文件。
这一切都很好,我能够在机器上的jupyter笔记本中运行代码。由于这是一种深度学习模型,因此花了几个小时才完成任务。但是,当我喝咖啡时,我回来了,笔记本上说“未连接”。我检查了远程服务器,一切仍然在运行,因此在那边也很好。但是在我的本地计算机上,终端不断输出
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 2: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
...