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 warnings in prototype transforms test suite #6785

Merged
merged 6 commits into from
Oct 18, 2022

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Oct 18, 2022

We have quite a few warnings in our prototype test suite: https://github.com/pytorch/vision/actions/runs/3268600734/jobs/5375203177#step:13:2309 Especially, the deprecation warnings are quite large and clutter the test summary. This PR fixes the test suite to avoid warnings.

In the future we should also check whether or not we want to put @pytest.mark.filterwarnings("error") onto the common tests like we do for the datasets common tests:

@pytest.mark.filterwarnings("error")
class TestCommon:

This would prevent warnings from creeping in.

@@ -598,6 +599,7 @@ def check_call_consistency(
for idx, args_kwargs in enumerate(config.args_kwargs)
],
)
@pytest.mark.filterwarnings("ignore")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since these are throw-away tests anyway, I didn't bother to write a proper warnings handling on this test. All warnings here were deprecation warnings from us, so there is nothing to do besides ignoring anyway.

# as PIL -> numpy is always copying
return

inpt[0, 0, 0] = 11
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can no longer test this, since the .contiguous() call will always copy.

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

OK for me, thanks @pmeier , I let you merge this PR once we confirmed that no more cluttering warnings in proto tests.

@pmeier
Copy link
Collaborator Author

pmeier commented Oct 18, 2022

CI failures are unrelated.

@pmeier pmeier merged commit 32757a2 into pytorch:main Oct 18, 2022
@pmeier pmeier deleted the prototype-test-warnings branch October 18, 2022 14:52
facebook-github-bot pushed a commit that referenced this pull request Oct 21, 2022
Summary:
* fix, ignore, or assert warnings for consistency tests

* fix, ignore, or assert warnings for kernel infos

* fix to_image_tensor for numpy inputs

* make image from numpy contiguous

* fix test

Reviewed By: YosuaMichael

Differential Revision: D40588163

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

3 participants