簡體   English   中英

如何在谷歌雲 AI 平台中增加 jupyter notebook 最大緩沖區大小?

[英]How to increase jupyter notebook max buffer size in google cloud AI platform?

我在 Google Cloud Platform 上運行 Jupyter notebook。 我有一個大pickeld Dataframe要閱讀。 由於 Jupyter Notebook 的默認緩沖區大小約為 0.5 Gb,因此它會崩潰並重新啟動內核。 我在 Compute Engine 的jupyter_notebook_config.py中添加了NotebookApp.max_buffer_size='my desired value'但問題仍然存在。

我認為調整實例大小應該會改變內存限制,但是我在調​​整到更大的實例時遇到了同樣的問題,這是我的解決方法:

我建議您在嘗試之前保存您的工作,以防萬一。

Jupyter 作為服務運行,所以打開它的服務配置:

sudo vim /lib/systemd/system/jupyter.service;

你應該看到這個配置:

[Unit]
Description=Jupyter Notebook

[Service]
Type=simple
PIDFile=/run/jupyter.pid
MemoryHigh=34359738368
MemoryMax=34359738368
ExecStart=/bin/bash --login -c '/opt/conda/bin/jupyter lab --config=/home/jupyter/.jupyter/jupyter_notebook_config.py'
User=jupyter
Group=jupyter
WorkingDirectory=/home/jupyter
Restart=always

[Install]
WantedBy=multi-user.target

將 MemoryHigh 和 MemoryMax 更改為所需的字節值。

然后:

sudo systemctl daemon-reload
sudo systemctl restart jupyter

稍等片刻,讓 jupyter 重新啟動,您應該就可以開始了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM