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

Warning: "Images sizes do not match" when W&B logging enabled #3575

Closed
glenn-jocher opened this issue Jun 10, 2021 · 14 comments · Fixed by #3611 or #4257
Closed

Warning: "Images sizes do not match" when W&B logging enabled #3575

glenn-jocher opened this issue Jun 10, 2021 · 14 comments · Fixed by #3611 or #4257
Labels
question Further information is requested

Comments

@glenn-jocher
Copy link
Member

glenn-jocher commented Jun 10, 2021

@AyushExel training with W&B logging enabled in Colab notebook I get some strange warning messages (which are printed in incorrect English):
https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb

Default training

Screenshot 2021-06-10 at 13 16 39

W&B Logged training

Screenshot 2021-06-10 at 13 17 13

This message is not originating within the repository. Can you take a look at this and try to figure out what is happening? Thanks!
Screenshot 2021-06-10 at 13 19 47

@glenn-jocher glenn-jocher added the question Further information is requested label Jun 10, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jun 10, 2021

👋 Hello @glenn-jocher, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at [email protected].

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@AyushExel
Copy link
Contributor

@glenn-jocher It's from here in the client. It is a warning about how the images of different sizes might not be displayed correctly in the same panel. I think this warning is raised because the size of test images is different from mosiacs(?) This should not cause any problem here because we're using different panels for mosiacs/metrics and the test images.

I'll have exact details shortly

@glenn-jocher
Copy link
Member Author

glenn-jocher commented Jun 10, 2021

@AyushExel ok I see. We probably want to suppress this warning then so as not to worry users and improve our overall UI/UX. I did something similar today with a Seaborn warning when plotting empty confusion matrices. This uses a context manager to ignore warnings for certain sections of the code: #3576

@glenn-jocher
Copy link
Member Author

@AyushExel any updates on this? I searched our issues and it seems this problem has been present since December 2020, first reported in #1676 about 2000 issues ago.

I think at the minimum if a fix in the W&B codebase (ideal solution) is not possible quickly then you should place the ops that cause this (presumably somewhere in utils/wandb_logging) under a warning suppression to prevent this from displaying to screen.

@AyushExel
Copy link
Contributor

Oh yeah, I forgot to update you on this. Client fixes take time so I'll wrap it under a warning suppression.

@glenn-jocher
Copy link
Member Author

@AyushExel awesome, thanks!

@glenn-jocher
Copy link
Member Author

The code I've used before for this is:

import warnings

with warnings.catch_warnings():                
    warnings.simplefilter('ignore')
    # code that produces warning

# normal code

@AyushExel
Copy link
Contributor

@glenn-jocher client uses logging.warning("message") so this doesn't work. I'm trying this - https://stackoverflow.com/a/60448982/8253860

@AyushExel
Copy link
Contributor

Okay, that didn't work. I'm trying a hacky way. PR up shortly.

@AyushExel
Copy link
Contributor

@glenn-jocher fix here -> #3611

@glenn-jocher glenn-jocher linked a pull request Jun 14, 2021 that will close this issue
@glenn-jocher glenn-jocher reopened this Jul 31, 2021
@glenn-jocher
Copy link
Member Author

glenn-jocher commented Jul 31, 2021

@AyushExel I'm getting this warning still today in Colab, it does not seem to be resolved. Can you look into this please?

If there is a problem we need to fix it, else we need to suppress this message, those are our only two options here.

Screenshot 2021-07-31 at 23 13 54

@glenn-jocher
Copy link
Member Author

@AyushExel training without wandb installed in Colab I verify no warnings, so I believe they originate in W&B:
Screenshot 2021-07-31 at 23 18 20

@AyushExel
Copy link
Contributor

@glenn-jocher looking at the source, I think I know where these are getting generated. We need to enclose all wandb.Image logging operations in the context manager that suppresses the message. I'm on phone now, I'll push a fix tomorrow

@glenn-jocher
Copy link
Member Author

@AyushExel awesome thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants