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

Fix CutMix and MixUp arguments in transforms.py #8287

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

zhulinchng
Copy link
Contributor

both torchvision.transforms.v2.CutMix and torchvision.transforms.v2.MixUp uses num_classes instead of num_categories as arguments.

both torchvision.transforms.v2.CutMix and torchvision.transforms.v2.MixUp uses num_classes instead of num_categories as arguments.
Copy link

pytorch-bot bot commented Mar 4, 2024

🔗 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 Failures

As of commit 45cd8b1 with merge base 2c127da (image):

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)
Copy link
Member

@NicolasHug NicolasHug Mar 4, 2024

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.

Copy link
Contributor Author

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
Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @zhulinchng !

@NicolasHug NicolasHug merged commit 3b5e6fc into pytorch:main Mar 4, 2024
26 of 76 checks passed
facebook-github-bot pushed a commit that referenced this pull request Mar 20, 2024
Reviewed By: vmoens

Differential Revision: D55062763

fbshipit-source-id: 2cbc9ea8f78350a6c844c3ffd2b32c63b66e2c5c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants