-
Notifications
You must be signed in to change notification settings - Fork 370
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
ObjectDetectionTask: increase test coverage for torchvision 0.14+ #1739
ObjectDetectionTask: increase test coverage for torchvision 0.14+ #1739
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why we never encountered this issue before, but it fails consistently every time in your PR that bumps torch/torchvision versions. Did something change?
There's a lot of code duplication here. Can we:
- Move
plot_no_rgb
andno_plot_method
totests/trainers/conftest.py
so they can be shared? - Combine
test_no_rgb
andtest_no_plot_method
into a single parameterizedtest_plot
method?
@adamjstewart, I may not have time to finish this in the next few days since I'm traveling. Not sure if you want to finish it up. |
Something did indeed change: pytorch/vision#6123 So we used to be generating (10, 4) random floats. The chances that any particular tuple satisfies xmax > xmin AND ymax > ymin is 0.25. The chances that all 10 tuples satisfy this is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding this bug! Glad it was only in our testing code and not in the core library.
) * fix test coverage in trainers validation step * add tests for multilabelclassificationtask * Minimal bug fix for now * Simpler random code --------- Co-authored-by: Adam J. Stewart <[email protected]>
The try/except in the ObjectDetection trainer's validation step was suppressing the following errors which drives this PR. These errors are caused by the use of
torch.rand
to generate dummy bounding box data which results in some cases wherexmax < xmin
and/orymax < ymin
which results in the bounding box plotting throwing a ValueErrorAdditionally, this PR adds a missing test for covering the case where
fig
returned by the plot method isNone
because the dataset has no plot method.