如何增加Jupyter笔记本的内存限制? [英] How to increase Jupyter notebook Memory limit?

查看:3609
本文介绍了如何增加Jupyter笔记本的内存限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 10上使用带有Python3的jupyter笔记本.我的计算机具有8GB RAM,至少有4GB RAM是可用的.

I am using jupyter notebook with Python3 on windows 10. My computer has 8GB RAM and at least 4GB of my RAM is free.

但是当我想使用以下命令制作大小为6000 * 6000的numpy ndArray时: np.zeros((6000, 6000), dtype='float64') 我知道了:Unable to allocate array with shape (6000, 6000) and data type float64

But when I want to make a numpy ndArray with size 6000*6000 with this command: np.zeros((6000, 6000), dtype='float64') I got this : Unable to allocate array with shape (6000, 6000) and data type float64

我认为这可能不会使用超过100MB的RAM. 我试图更改数字以查看会发生什么.我可以做的最大数组是(5000,5000).在估算我需要多少RAM时是否犯了错误?

I don't think this could use more then 100MB RAM. I tried to change the number to see what happens. The biggest array I can make is (5000,5000). Did I make a mistake in estimating how much RAM I need?

推荐答案

Jupyter笔记本具有默认的内存限制大小.您可以按照以下步骤尝试增加内存限制:
1)使用命令生成配置文件:

Jupyter notebook has a default memory limit size. You can try to increase the memory limit by following the steps:
1) Generate Config file using command:

jupyter notebook --generate-config

2)打开'jupyter'文件夹中的jupyter_notebook_config.py文件,然后编辑以下属性:

2) Open jupyter_notebook_config.py file situated inside 'jupyter' folder and edit the following property:

NotebookApp.max_buffer_size = your desired value

请记住在属性值之前删除#".
3)保存并运行jupyter笔记本. 现在,它应该使用设置的内存值. 另外,不要忘记从jupyter文件夹中运行笔记本.

Remember to remove the '#' before the property value.
3) Save and run the jupyter notebook. It should now utilize the set memory value. Also, don't forget to run the notebook from inside the jupyter folder.

或者,您可以简单地使用以下命令运行Notebook:

Alternatively, you can simply run the Notebook using below command:

 jupyter notebook --NotebookApp.max_buffer_size=your_value

这篇关于如何增加Jupyter笔记本的内存限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆