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

Progress bar in Jupyter adds newlines for each validation step #1399

Closed
tcwalther opened this issue Apr 7, 2020 · 11 comments
Closed

Progress bar in Jupyter adds newlines for each validation step #1399

tcwalther opened this issue Apr 7, 2020 · 11 comments
Labels
bug Something isn't working help wanted Open to be worked on

Comments

@tcwalther
Copy link

tcwalther commented Apr 7, 2020

🐛 Bug

Pytorch lightning prints newlines when showing the validation progress bar. See attached screenshot.

This may be a bug with nested progress bars in tqdm. I'm using the recent tqdm 4.45.0; I also had the issue with tqdm 4.43.0.

Screenshot 2020-04-07 at 12 31 30

To Reproduce

Steps to reproduce the behavior:

In a Jupyter notebook, run trainer.fit(model) on any model that has a validation step.

Code sample

Expected behavior

No newlines should be added.

Environment

cuda:
        GPU:
                Tesla K80
        available:           True
        version:             10.1
packages:
        numpy:               1.17.4
        pyTorch_debug:       False
        pyTorch_version:     1.4.0
        pytorch-lightning:   0.7.1
        tensorboard:         2.2.0
        tqdm:                4.45.0
system:
        OS:                  Linux
        architecture:
                64bit

        processor:           
        python:              3.7.3
        version:             #1 SMP Debian 4.9.168-1+deb9u4 (2019-07-19)

Additional context

@tcwalther tcwalther added bug Something isn't working help wanted Open to be worked on labels Apr 7, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2020

Hi! thanks for your contribution!, great first issue!

@williamFalcon
Copy link
Contributor

upgrade to master. i think it’s fixed there

@williamFalcon
Copy link
Contributor

happy to reopen if it isn’t

@tcwalther
Copy link
Author

Thanks for your swift reply. I'm afraid it's still an issue after upgrading.

Screenshot 2020-04-07 at 13 05 41

@tcwalther
Copy link
Author

What happens in Jupyter is that there's a bunch of empty divs left over. I expanded one for illustration, too.

Screenshot 2020-04-07 at 13 08 27

@williamFalcon
Copy link
Contributor

williamFalcon commented Apr 7, 2020

maybe submit a PR?

Looks like this issue might have some solutions.
tqdm/tqdm#375

@williamFalcon williamFalcon reopened this Apr 7, 2020
@tcwalther
Copy link
Author

tcwalther commented Apr 7, 2020

Turns out this is a bug in tqdm. I will file an issue there.
Easiest way to reproduce:

from tqdm.auto import tqdm
from time import sleep

for _ in tqdm(range(5)):
    for _ in tqdm(range(5), leave=False):
        sleep(0.01)

Feel free to close this issue. And thanks for replying so swiftly, it really motivated to dig into the issue myself :-).

@tcwalther
Copy link
Author

tcwalther commented Apr 7, 2020

I had a look at that issue you linked, but it didn't seem fully relevant. I've filed a new issue:

tqdm/tqdm#935

@tcwalther
Copy link
Author

Looks like this has been an issue between jupyterlab and ipywidgets for quite some time (jupyter-widgets/ipywidgets#1845), and seems to be a main motivator why the fastai people wrote their own progress bar library:

AnswerDotAI/fastprogress#6

Would you consider switching to fastprogress, too? I understand the library is a lot less common than tqdm, but it may be more suitable for this project.

@Borda
Copy link
Member

Borda commented Apr 8, 2020

let's open a new issue with a discussion about fastprogress,
see https://github.com/fastai/fastprogress

@Borda Borda closed this as completed Apr 8, 2020
@tcwalther
Copy link
Author

@Borda will do so now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Open to be worked on
Projects
None yet
Development

No branches or pull requests

3 participants