Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repair corrupted Jupyter notebook / load previous version?

I had a hardware crash while running a Jupyter notebook. After repairing the system and trying to restart the notebook, I got the following error message:

Error loading notebook Unreadable Notebook: D:\Eddy\Documents\1604 Udacity\1612 Self-driving car Nanodegree\P4\P4 Eduard van Kleef.ipynb NotJSONError("Notebook does not appear to be JSON: ''...",)

Does anyone know of a way to revert to any of Jupyter's previous 'checkpoints'? Or of a way to at least partially restore a JSON?

like image 549
EddyvK Avatar asked Jan 24 '26 11:01

EddyvK


2 Answers

Try this

jupyter nbconvert filename.ipynb --clear-output

It worked for me since it has corrupted because of Plotly behavior with some big data.

like image 119
Rhuan Barros Avatar answered Jan 27 '26 05:01

Rhuan Barros


If you are lucky then the ipynb file is corrupted but still there. In that case you can try opening it in a text file and copying the contents to a new notebook. But check the size of the file. If it is zero bytes, then there is nothing there!

This actually happened to me when my server ran out of memory and somehow the notebook got completely erased. Totally sucks.

like image 25
Bow Avatar answered Jan 27 '26 06:01

Bow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!