-
Notifications
You must be signed in to change notification settings - Fork 7k
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
extract make_* functions out of make_*_loader #7717
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7717
Note: Links to docs will display an error until the docs builds have been completed. ❌ 5 New FailuresAs of commit 519f0fa: NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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 Philip, took a quick glance as discussed offline
Regarding removing vision/test/test_transforms_v2_refactored.py Lines 312 to 317 in 2d4484f
Since we need this somehow, one possibility is to add two new functions Another option would be to add a Regardless of which option we choose, if we remove @pytest.mark.parametrize(
("kernel", "make_input"),
[
# TODO: add simple tensor / PIL image handling
(F.resize_image_tensor, make_image),
(F.resize_bounding_box, make_bounding_box),
(F.resize_mask, make_segmentation_mask),
(F.resize_video, make_video),
],
) That should work fine in general, but I already found one instance in the tests ported so far, that branch on the vision/test/test_transforms_v2_refactored.py Lines 748 to 753 in 2d4484f
If we go for the standalone functions, we can still do this although it looks a little quirky if make_input is make_image_tensor and interpolation is transforms.InterpolationMode.NEAREST_EXACT:
... However, if we use Admittedly, the branching above is uncommon and I don't expect significantly more of this pattern in the future. Meaning, we could just special case it and parametrize over the |
Thanks for investigating Philip
If that's the case then I guess we can safely get rid of it |
Re
(EDIT: A few edits from @NicolasHug as discussed offline) |
closeness_kwargs={ | ||
(("TestKernels", "test_against_reference"), torch.int64, "cpu"): dict(atol=1, rtol=0), | ||
}, |
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.
I guess we were lucky before that we never hit that. Converting to or from CXCYWH with integer dtypes can lead to rounding errors. Now that we have refactored make_bounding_box
, we are seeing two of those errors in this test.
The diff in this PR grew pretty large so here is a summary of the changes:
|
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 Philip
Test failures are real |
Test failures stem likely from a bad reference function. I can reproduce the same error on |
Reviewed By: matteobettini Differential Revision: D48642276 fbshipit-source-id: b60d934f09cb1fb4678101bdba2eef4b4adefa89
Our current
make_*
functions are thin wrappers around the correspondingmake_*_loader
function. The latter is only needed for the "deprecated" v2 tests. Thus, we invert the logic here and create a standalonemake_*
function that has a correspondingmake_*_loader
function that depends on it.