One day the jupyter notebook suddenly stopped opening [memory error]

What happened

Detect the object with jupyter notebook by packing the kaggle kernel. Learn machine learning before going to bed. Memory error when waking up in the morning And when I try to open the notebook again, it's heavy. And can't open (memory error) (I forgot to take a photo)

Well, I wondered what happened, and when I tried to push to git for the time being, an error occurred. Reason ... 150MB. Eh! Not so much! I thought

Reason

I can't open jupyter, so I have to open .ipynb with vim. light And notice

スクリーンショット 2021-01-14 16.34.10.png

2 million lines

If you take a look at ipynb, it's for debug

print(images)

The ones I have saved are displayed infinitely. 2 million lines

It doesn't bother me because it folds up in my notebook, but it seems like it happened because I record everything in memory. So I erase this 2 million lines with vim

2000000 dd

Then, if you adjust the key brackets etc., you can open it

in short

It may be dangerous to print too carelessly

Recommended Posts

One day the jupyter notebook suddenly stopped opening [memory error]
Multiprocessing error in Jupyter Notebook
Simply view the Jupyter notebook file
Memory leak in Python Jupyter Lab (Notebook)?
The story that scipy suddenly stopped loading
Clone the github repository on jupyter notebook