首页 > 解决方案 > 关闭本地机器后,继续在 jupyter notebook 中远程运行一个单元

问题描述

我正在使用我的本地机器并在服务器中运行我的算法。为了让 Jupyter 笔记本保持运行,我在服务器中运行以下命令:

nohup jupyter notebook --no-browser &

我通过这个 cmd 访问本地机器上的 jupyter notebook 服务器:

ssh -nNT -L 9999:localhost:8888 myuser@ipServer

我试图在 jupyter 的一个单元格中运行这两条编码线:

profile=pandas_profiling.ProfileReport(df)
profile.to_file(outputfile='myoutputfile_FINAL_DATASET.html')

数据集很大:4,51 GB,840.000 行和 5308 列(运行它需要 4 天)

我想如果我添加这两行运行 nohup 它将保留变量配置文件,并转到下面的行。但是,变量配置文件似乎在完成第一行运行后就消失了。

在本地机器上关闭 jupyter notebook 时,是否有运行整个单元格的方法?

编辑:

今天早上发现有事,突然在[I 06:54:03.346 NotebookApp]处内核无故重启

[I 12:43:53.577 NotebookApp] Starting buffering for c9688f9f-ed12-4eff-a18c-aa300b62faf1:8a1a4286bc5d43d6823c15c9ad8c9512
[I 12:43:55.592 NotebookApp] Starting buffering for b207c9f7-f0c7-40e7-8f67-1c85024a8be6:4a9971a622294cd1832873e0fbc181f0
[I 06:54:03.346 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
[I 09:35:34.509 NotebookApp] 302 GET / (127.0.0.1) 24.76ms
[W 09:35:35.347 NotebookApp] 404 GET /apple-touch-icon-precomposed.png (127.0.0.1) 53.83ms referer=None
[W 09:35:35.376 NotebookApp] 404 GET /apple-touch-icon.png (127.0.0.1) 1.23ms referer=None
[I 09:35:47.593 NotebookApp] Adapting to protocol v5.1 for kernel b207c9f7-f0c7-40e7-8f67-1c85024a8be6
[I 09:37:47.424 NotebookApp] Saving file at /Profiling_FINAL_DATASET.ipynb
[I 09:39:49.759 NotebookApp] Saving file at /Profiling_FINAL_DATASET.ipynb
[I 09:41:49.777 NotebookApp] Saving file at /Profiling_FINAL_DATASET.ipynb
[W 09:44:47.657 NotebookApp] WebSocket ping timeout after 119897 ms.
[I 09:44:52.708 NotebookApp] Starting buffering for b207c9f7-f0c7-40e7-8f67-1c85024a8be6:eb4a6d0415604f078b9c0229d93cdc33
[I 10:04:17.875 NotebookApp] Adapting to protocol v5.1 for kernel b207c9f7-f0c7-40e7-8f67-1c85024a8be6
[I 10:04:17.884 NotebookApp] Restoring connection for b207c9f7-f0c7-40e7-8f67-1c85024a8be6:eb4a6d0415604f078b9c0229d93cdc33
[I 10:04:25.803 NotebookApp] 302 GET / (127.0.0.1) 3.45ms
[I 10:04:42.583 NotebookApp] Adapting to protocol v5.1 for kernel b207c9f7-f0c7-40e7-8f67-1c85024a8be6
[I 10:07:56.233 NotebookApp] Saving file at /Profiling_FINAL_DATASET.ipynb
[I 10:09:56.421 NotebookApp] Saving file at /Profiling_FINAL_DATASET.ipynb

标签: pythonpandasserverjupyter-notebook

解决方案


推荐阅读