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

YOLOv5 tqdm progress bar multi-line output bug #1307

Open
5 of 6 tasks
glenn-jocher opened this issue Mar 11, 2022 · 4 comments
Open
5 of 6 tasks

YOLOv5 tqdm progress bar multi-line output bug #1307

glenn-jocher opened this issue Mar 11, 2022 · 4 comments
Labels
need-feedback 📢 We need your response (question) p2-bug-warning ⚠ Visual output bad

Comments

@glenn-jocher
Copy link

  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
  • I have visited the [source website], and in particular
    read the [known issues]
  • I have searched through the [issue tracker] for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:

We use tqdm extensively in YOLOv5 https://github.com/ultralytics/yolov5, and most of the time it works great!

Sometimes it will start outputting a new line per progress bar update though, which causes many problems. This is especially prevalent (100% occurrence rate) when running in a Docker image after some time, or running a Docker image in detached mode:

Screenshot 2022-03-11 at 12 09 18

YOLOv5 🚀 v6.1-25-gcaf7ad0 torch 1.11.0 CPU

# Run latest YOLOv5 Docker Image
t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it $t

# inside Docker container start training YOLOv5 model
python train.py

Our exact tqdm implementation is here:
https://github.com/ultralytics/yolov5/blob/caf7ad0500f8fc58567a7aa01ca91d5ee77691d6/train.py#L302-L308

        pbar = tqdm(pbar, total=nb, bar_format='{l_bar}{bar:10}{r_bar}{bar:-10b}')  # progress bar
        for i, (imgs, targets, paths, _) in pbar:
            # do stuff 

I've tried everything I can think of, including defining a format (shown above), defining a fixed terminal size, using the default settings, and this problem still occurs every time. Any ideas for how we can fix this?

@casperdcl
Copy link
Sponsor Member

Interesting, I can't reproduce this. Works fine (progress is on one line):

docker run -it tqdm/tqdm python -c 'from tqdm import trange; [0 for _ in trange(int(1e8))]'

Related: #771?

@casperdcl casperdcl added need-feedback 📢 We need your response (question) p2-bug-warning ⚠ Visual output bad labels Jun 18, 2022
@thomassajot
Copy link

This issue is still relevant.
Happens on TMUX or Bash, Ubuntu 18, python 3.9. How can we investigate ?

@niko-zvt
Copy link

niko-zvt commented Feb 20, 2023

This issue is still relevant.
Happens with Jupyter Notebook, python 3.10.

@glenn-jocher
Copy link
Author

Yes, still happens for us in YOLOv5. Also happens in our GitHub CI runners, i.e. see:
https://github.com/ultralytics/yolov5/actions/runs/4218882205/jobs/7323729521

Screenshot 2023-02-20 at 19 53 46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-feedback 📢 We need your response (question) p2-bug-warning ⚠ Visual output bad
Projects
None yet
Development

No branches or pull requests

4 participants