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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fastprogress callback #2

Closed
ethanwharris opened this issue Apr 15, 2020 · 8 comments
Closed

Fastprogress callback #2

ethanwharris opened this issue Apr 15, 2020 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed won't fix This will not be worked on

Comments

@ethanwharris
Copy link
Contributor

馃殌 Feature

Copied from Lightning-AI/pytorch-lightning#1500 by @tcwalther

Use https://github.com/fastai/fastprogress instead of tqdm for displaying progress bars.

Motivation

tqdm doesn't work well with Jupyter Lab. This creates issues with pytorch-lightning's progress bars, where each validation bar creates a newline in the cell output: #1399. This is a well-known issue in jupyter-widgets: jupyter-widgets/ipywidgets#1845

The Fast.ai people developed fastprogress as a replacement for exactly this reason.

Pitch

Option to replace tqdm with fastprogress.

Alternatives

The alternative is to wait for jupyter-widgets to fix the issue on their side. Given that this issue has been around since November 2017, I'm not too hopeful that it will happen, though. It looks like this would require major design changes in ipywidgets and/or jupyter-lab.

Additional context

Motivated by #1399.

@awaelchli
Copy link
Contributor

Now that we have the progress bar as callback, we should be able to easily replace tqdm with fastprogress and provide an alternative callback.

@williamFalcon
Copy link
Contributor

williamFalcon commented Apr 24, 2020

but we don't want to add fastai as a dependency no? or i guess this is a separate smaller repo.

oh this is bolts lol... sure, that works i think

@Borda
Copy link
Member

Borda commented May 28, 2020

fastprogress is separate repo/package https://pypi.org/project/fastprogress

@awaelchli
Copy link
Contributor

I played around a bit with fastprogress, and found some shortcomings.

  1. It does not support infinite iterators (it needs to call len), which for us is not good because we support iterable datasets of arbitrary/variable/infinite length.
  2. Does not properly display in PyCharm without going into settings and changing console behaviour.
  3. Cannot set the total/iterator after initializing the progressbar.
  4. Cannot manually update the progress (at least I couldn't find out how) and instead can only be directly applied in a loop. This is not practical for us since the callback is independent of the training loop.

It may be nicer in notebooks, but overall imo it is inferior to tqdm.
At this point, I don't really know a good way integrate it into PL.

@williamFalcon
Copy link
Contributor

nice makes sense.

maybe we should look at extending tqdm to work well with notebooks?

@Kshitij09
Copy link

Just want to share my experience:

I don't really know a good way to integrate it into PL.

I had tried to integrate it in the past and yes, it falls short for the points listed by @awaelchli

maybe we should look at extending tqdm to work well with notebooks?

This looks like a good idea! all we need is the ability to print between the two progress bars. The master progress_bar will serve as a complete training progress (max=no. of epochs) and the child will serve the current epoch progress. Once we've the ability to write between the progress bars, I'll be able to integrate my PrintCallback

@stale
Copy link

stale bot commented Oct 17, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label Oct 17, 2020
@Borda Borda removed the won't fix This will not be worked on label Oct 17, 2020
@stale
Copy link

stale bot commented Dec 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label Dec 16, 2020
@stale stale bot closed this as completed Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants