Autoreload slow
See original GitHub issueOn upgrading from 7.5 to 7.6.1, autoreload in Jupyter Notebook is much slower, to the point of seeming to hang for a >minute. When I lose my patience and interrupt execution, I get a traceback like this
[autoreload of algos.ppo.nets failed: Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 245, in check
superreload(m, reload, self.old_objects)
File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 450, in superreload
update_generic(old_obj, new_obj)
File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 387, in update_generic
update(a, b)
File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 357, in update_class
update_instances(old, new)
File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 317, in update_instances
update_instances(old, new, obj, visited)
File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 317, in update_instances
update_instances(old, new, obj, visited)
File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 317, in update_instances
update_instances(old, new, obj, visited)
[Previous line repeated 2 more times]
File "/opt/conda/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 300, in update_instances
for obj in (obj for obj in objects if id(obj) not in visited):
KeyboardInterrupt
]
I don’t have a minimal example I’m afraid, but if anyone arrives here Googling for a similar problem, rolling back to 7.5 fixes it.
My specs are
Ubuntu 18.04.2 LTS Python 3.73 Jupyter:
jupyter==1.0.0
jupyter-client==5.3.0
jupyter-console==6.0.0
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.1
jupyter-core==4.5.0
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.6
jupyter-nbextensions-configurator==0.4.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:19 (10 by maintainers)
Top Results From Across the Web
tf2 does auto reload slow your firing speed - Reddit
tf2 does auto reload slow your firing speed ... No. If anything, it helps a ton. ... I just wish they'd remove the...
Read more >Using autoreload to speed up IPython and Jupyter work
I try to do all of my interactive Python development with either Jupyter notebooks or an IPython session. One of the main reasons...
Read more >Jupyter autoreload workflow - Stack Overflow
I'm trying to understand the best workflow for impotring script files into a jupyter notebook. I have a notebook that does somethig like:...
Read more >Slow autoreload - Questions and Answers
Is there a way to speed up Strapi when auto reloading? Strapi takes about 4-8 seconds each time I modify a controller.
Read more >Automatically Reload Modules with %autoreload
%autoreload to the rescue! ... IPython with %autoreload enabled will be slightly slower. IPython is quite smart about what to reload.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can’t add further debug info, but I had a similar problem with ipython-7.6.1 and Spyder-3.3.6:
Every other time, this causes ipython to hang until interrupted by ctr+c, which then gives a stacktrace as pasted above. Repeating the exact same procedure works fine on the next try. Downgrading to ipython-7.5 resolved the issues.
This is all on a Ubuntu 16.04, with Spyder and ipython installed via pip3:
To fix the issue:
Is there further info I could provide?
This problem seems to be extra bad when I’m working with large pandas
DataFrame
s; is it possible that every single string value is getting scanned by the autoreload logic? If so is there any possible way to work around this case?