-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Fix CutMix and MixUp arguments in transforms.py #8287
Conversation
both torchvision.transforms.v2.CutMix and torchvision.transforms.v2.MixUp uses num_classes instead of num_categories as arguments.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8287
Note: Links to docs will display an error until the docs builds have been completed. ❌ 33 New Failures, 7 Unrelated FailuresAs of commit 45cd8b1 with merge base 2c127da ( NEW FAILURES - The following jobs have failed:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@@ -13,13 +13,13 @@ def get_mixup_cutmix(*, mixup_alpha, cutmix_alpha, num_categories, use_v2): | |||
mixup_cutmix = [] | |||
if mixup_alpha > 0: | |||
mixup_cutmix.append( | |||
transforms_module.MixUp(alpha=mixup_alpha, num_categories=num_categories) | |||
transforms_module.MixUp(alpha=mixup_alpha, num_classes=num_categories) |
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 a lot for the report and for the fix @zhulinchng . Can you also change the signature of get_mixup_cutmix
to accept a num_classes
parameter instead of num_categories
? This way, there would only be the num_classes
parameter, and not num_categories
.
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 @NicolasHug for the suggestion, I have updated the PR with the changes to get_mixup_cutmix
.
this replaces num_categories, for consistency
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.
Thank you @zhulinchng !
Reviewed By: vmoens Differential Revision: D55062763 fbshipit-source-id: 2cbc9ea8f78350a6c844c3ffd2b32c63b66e2c5c
both torchvision.transforms.v2.CutMix and torchvision.transforms.v2.MixUp uses num_classes instead of num_categories as arguments.