Skip to content

Fixed broken test_random_choice #7315

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

Merged
merged 7 commits into from
Feb 24, 2023
Merged

Conversation

vfdev-5
Copy link
Collaborator

@vfdev-5 vfdev-5 commented Feb 23, 2023

test_random_choice is broken on main:

Description:

  • Fixed test_random_choice and test_asserts.
  • Improved error message in RandomChoice

cc @pmeier

@vfdev-5 vfdev-5 requested a review from NicolasHug February 24, 2023 08:52
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.

Thanks for the PR @vfdev-5 , the changes to RandomChoice LGTM, however I don't think we should mark the other tests as xfail.

Those tests are passing on most jobs, they're only failing on 3.10. But the problem isn't the tests in themselves, the tests are merely surfacing a (packaging?) issue that is tracked in #7299, and which hopefully the releng team will be able to address soon.

I'd prefer keeping those tests in to make sure our warnings work as expected, and ignore the 3.10 signals for now

@NicolasHug
Copy link
Member

In fact the 3.9 and 3.8 jobs are now failing because we use strict xfail: pytest expects those tests to fail but they actually pass, so it raises an error/

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.

Thanks @vfdev-5 !

Copy link
Collaborator

@pmeier pmeier left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -822,7 +822,7 @@ def test_random_choice(self, probabilities):
v2_transforms.Resize(256),
legacy_transforms.CenterCrop(224),
],
probabilities=probabilities,
p=probabilities,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: should we also rename the parameter to p?

Suggested change
p=probabilities,
p=p,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it is ok

@vfdev-5 vfdev-5 merged commit aef00c4 into pytorch:main Feb 24, 2023
@vfdev-5 vfdev-5 deleted the fix-test_random_choice branch February 24, 2023 10:57
@github-actions
Copy link

Hey @vfdev-5!

You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

NicolasHug pushed a commit to NicolasHug/vision that referenced this pull request Feb 24, 2023
facebook-github-bot pushed a commit that referenced this pull request Mar 29, 2023
Reviewed By: vmoens

Differential Revision: D44416538

fbshipit-source-id: cc263e069795e0059f9a6708976f1f8232c9a304
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.

4 participants