-
Notifications
You must be signed in to change notification settings - Fork 378
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
Resolve DeprecationWarnings #567
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adamjstewart
commented
Jun 10, 2022
5 tasks
calebrob6
approved these changes
Jun 13, 2022
re Pillow being really slow, we do already have an opencv dependency, so could use that |
According to pytorch/vision#6153, Pillow-SIMD is actually faster than OpenCV and Tensor operations on the GPU. |
Merged
yichiac
pushed a commit
to yichiac/torchgeo
that referenced
this pull request
Apr 29, 2023
* Resolve DeprecationWarnings * Fix PIL version check * Add ignores, hide ignores * Always specify max_epochs * Re-add one of the ignores that was removed * Silence ColorJitter behavior change warnings * Fix num_workers warning on macOS * Ignore coverage of lines missed by older pillow versions * Fix support for pre/post versions of PIL * Wordsmithing * Remove unused imports
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
datamodules
PyTorch Lightning datamodules
datasets
Geospatial or benchmark datasets
testing
Continuous integration testing
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the third PR in a series of attempts to improve the stability and robustness of TorchGeo's build system (#557, #551).
If you look at the logs for our unit tests, you'll see a slew of warning messages, desperately trying to warn us that TorchGeo is using deprecated features that will be removed in future versions of our dependencies. Up until now, these were ignored until someone noticed/reported an issue. With this PR, these kind of warnings will become fatal. We weren't able to do something this extreme before, but now that we use dependabot, we can restrict these kind of failures to version update PRs, not user PRs.
Deprecation Fixes
len(index)
method to replaceindex.get_size()
(see Add __len__ method to Index Toblerity/rtree#207). The latter is now deprecated and may be removed someday.Image.*
toImage.Resampling.*
. The former is now deprecated and will be removed in Pillow 10Considerations
I did the former for rtree/torchmetrics/other instances because I didn't see a good reason not to, but I did the latter for pillow because pillow-simd doesn't yet have a 9.1.0 release and normal pillow is much slower. There's also the question of how to maintain coverage of both branches. This may require a test using the minimum supported versions: #32.
So far I'm just ignoring these using
filterwarnings
, but that may not be sufficient. What I would really love is an option to only issue warnings for our own code, not for dependencies, but I don't believe that's an option. One potential issue here is if a dep of a dep has a new release that causes the tests to fail, but it isn't managed by dependabot because it's not a direct dep.Ideally, our tests will pass not only on CI which uses the latest versions of everything, but also locally where users may have any version of these dependencies installed. I'm not sure if it's worth keeping a running list of all possible warning messages for all versions of our dependencies. One option would be to remove
"error"
fromfilterwarnings
inpyproject.toml
and instead usepytest -Werror
in CI so that warnings are only considered errors in CI, not locally.