Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter progress bar creates infinite copies at 0% #1426

Closed
arvoelke opened this issue Apr 9, 2018 · 17 comments
Closed

Jupyter progress bar creates infinite copies at 0% #1426

arvoelke opened this issue Apr 9, 2018 · 17 comments
Assignees

Comments

@arvoelke
Copy link
Contributor

arvoelke commented Apr 9, 2018

If I checkout nengo==2.7.0, everything works using the progress bar in this style:

Building finished in 0:00:01.                                                   
[###################### Simulating... 73% #####                 ] ETA: 0:00:01

However, checking out the current commit on master, any simulation that takes longer than a couple of seconds will keep making copies of the progress bar at 0%. Copies continue to be made for as long as it is building, and for as long as it is simulating (a few each second). This slows everything down substantially.

progress_glitch

Versions:

  • nengo master
  • matplotlib 2.0.2
  • jupyter 4.3.0
  • IPython 5.3.0
@jgosmann
Copy link
Collaborator

jgosmann commented Apr 9, 2018

Can you try with the current master? (Containing PR #1380.)

@arvoelke
Copy link
Contributor Author

arvoelke commented Apr 9, 2018

That's what breaks it. The above shows the difference before/after PR #1380 (i.e., the difference between nengo==2.7.0 and current master).

@jgosmann
Copy link
Collaborator

jgosmann commented Apr 9, 2018

Ah sorry, I misread and thought you were using the release version. Do you have a nengorc file (~/.config/nengo/nengorc on Unix)? If so, can you post that?

@jgosmann
Copy link
Collaborator

jgosmann commented Apr 9, 2018

Also, which browser are you using?

@jgosmann jgosmann self-assigned this Apr 9, 2018
@jgosmann
Copy link
Collaborator

jgosmann commented Apr 9, 2018

jupyter 4.3.0

I assume this is the version of your notebook server? (The Jupyter meta package on PyPI is only 1.0.0.)

@jgosmann
Copy link
Collaborator

jgosmann commented Apr 9, 2018

You could also check the developer/JS console of your browser for error messages.

It works for me in Chrome and Firefox with notebook>=5.1. I tried testing with notebook==4.3.0, but for some reason it fails connecting to the kernel and don't want to sink time into trying to get that to work.

@arvoelke
Copy link
Contributor Author

arvoelke commented Apr 10, 2018

Ah sorry, I misread and thought you were using the release version. Do you have a nengorc file (~/.config/nengo/nengorc on Unix)? If so, can you post that?

I haven't added/customized a nengorc file.

Also, which browser are you using?

Chrome Version 65.0.3325.181 (Official Build) (64-bit)

I assume this is the version of your notebook server? (The Jupyter meta package on PyPI is only 1.0.0.)

Yep.

It works for me in Chrome and Firefox with notebook>=5.1.

This works for me as well!

I tried testing with notebook==4.3.0, but for some reason it fails connecting to the kernel ...

Same here. Since upgrading, if I try to go back to notebook==4.3.0 I can no longer connect to the kernel (some error about an unexpected keyword argument 'io_loop').

You could also check the developer/JS console of your browser for error messages.

Sorry, I should have checked this before trying to upgrade, now that I can no longer downgrade. There was not anything in the server logs, however.

@jgosmann
Copy link
Collaborator

I got notebook==4.3.0 running, by installing tornado<5. The progress bar does not work correctly for me, just stopping at 1%, but I don't get any additional copies.

@jgosmann
Copy link
Collaborator

Even this basic code isn't working for me:

from IPython.display import ProgressBar
pb = ProgressBar(10)
h = display(pb, display_id=True)
pb.progress = 5
h.update(pb)

So this might come down to Jupyter notebook bug rather than a Nengo bug.

@jgosmann
Copy link
Collaborator

Ok, so I did some research and apparently update-able outputs where only introduced in Jupyter client/notebook 5.0 (jupyter/notebook#1879, jupyter/jupyter_client#225). I am probably not going to invest time in trying to make it work with older versions.

@arvoelke
Copy link
Contributor Author

Can it be updated to use the old progress bar if the version isn't right? That still worked for me. Or raise a warning telling them what to update? I'd be surprised if I was the only one using an older Jupyter/etc. Thanks for looking into this!

@jgosmann
Copy link
Collaborator

I can't get it to work right now ... there is no ipywidgets<5 package, but ipywidgets==5 requires notebook>=4.4.1. So I installed ipywidgets==5 and notebook==4.4.1, activated the ipywidgets Javascript (jupyter nbextension enable --py --sys-prefix widgetsnbextension) and I'm still getting the message Widget Javascript not detected. It may not be installed properly..

The old progress bar also completely breaks the notebook (not just the progress bar) in thenotebook==5.1.0 release (and maybe others) and we cannot automatically check for the notebook version in a reliable way.

See #1087 for more discussion about dropping support for older notebook versions.

You still have the option to switch to the terminal progress bar (for really old IPython notebook versions this can lead to a large memory consumption and notebook size; for those, the progress bar should be completely disabled).

A message in unsupported notebook versions would be nice, but at the moment I cannot think of a way to achieve that.

@jgosmann
Copy link
Collaborator

Take a look at #1428. It implements a warning message for older notebook versions (apparently the notebook version can be checked in Javascript).

I'm not sure if that addresses/fixes the original issue as I never experienced the repeated progress bars.

@jgosmann
Copy link
Collaborator

@arvoelke Is this still happening to you? Did you try out #1428?

@arvoelke
Copy link
Contributor Author

Since upgrading, if I try to go back to notebook==4.3.0 I can no longer connect to the kernel (some error about an unexpected keyword argument 'io_loop').

So I can't exactly try without setting up a new env. Was hoping someone else would run into this before I tried to reproduce from a virtual env.

@jgosmann
Copy link
Collaborator

I never managed to reproduce the problem and I suppose no one else had it either.

@arvoelke
Copy link
Contributor Author

I am okay with this being closed under "cannot reproduce". Thanks for looking into it and figuring out the fix (upgrading notebook).

tbekolay pushed a commit that referenced this issue Aug 30, 2018
tbekolay pushed a commit that referenced this issue Aug 30, 2018
We do not support progress bars in Jupyter notebook<5.

Addresses #1426.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants