Jupyter Notebook (only) Memory Error, same code run in a conventional .py and works

我只是一个虾纸丫 提交于 2019-12-03 12:36:22

Try running with Administrator privileges. Worked for me.

I am only a year and 2 months late to this question. The technical answer as to why is really nicely explained here: https://superuser.com/questions/372881/is-there-a-technical-reason-why-32-bit-windows-is-limited-to-4gb-of-ram

It also implies why the conda solution works.

But for a lazy engineer's no-change workaround, close the Chrome tabs not absolutely necessary and restart your kernel so it starts afresh.

Kernel > Restart (& Run All)

Apparently this happens when the python installation is not the best.

As a matter of fact before solving the problem, I had installed on windows manually python 2.7 and the packages that I needed, after messing almost two days trying to figure out what was the problem, I reinstalled everything with Conda and the problem was solved.

I guess Conda is installing better memory management packages and that was the main reason.

Similar thing happened with me while loading .npy file. Freeing up RAM solved the issue. It didn't have enough memory to load file into variables. Actually, both firefox and chrome was running on my system and closing firefox solved the problem.

Useful Commands:free -h Note of precaution: before interpreting this command on your own. Its highly recommended to go through this page: https://www.linuxatemyram.com/ .

You can either reduce your dataset for training and testing this can solve your memory error problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!