PIL version check for enum change appears to break SIMD versions
See original GitHub issue🐛 Describe the bug
This change appears to break current Pillow-SIMD version #5898
if tuple(int(part) for part in PIL.__version__.split(".")) >= (9, 1):
File "/home/.../lib/python3.10/site-packages/torchvision/transforms/_pil_constants.py", line 7, in <genexpr>
if tuple(int(part) for part in PIL.__version__.split(".")) >= (9, 1):
ValueError: invalid literal for int() with base 10: 'post1'
Amusingly enough, I warned against this approach in a users PR in timm
https://github.com/rwightman/pytorch-image-models/pull/1256
Would be nice to have it fixed before 1.12 is finalized, I just hit this trying out the RC
Versions
PT 1.12 RC, TV 0.13.0
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:23 (15 by maintainers)
Top Results From Across the Web
Change log : linux package : Ubuntu - Launchpad
[Debian] Skip rebuild test, for regression-suite deps. ... created components in tplg load error - arm64: Relax GIC version check during early boot...
Read more >cc - Oracle Developer Studio 12.6 Man Pages
cc - C compiler Oracle Developer Studio 12.6 C Compiler version 5.14. This man page details the options or flags that are available...
Read more >Proceedings of the 21st Python in Science Conference
Changes to the standard (completed and proposed). These are based on lessons learned from usage. The current version of the standard is ...
Read more >New src/hotspot/cpu/aarch64/aarch64.ad
5 // 6 // This code is free software; you can redistribute it and/or modify it 7 // under the terms of the...
Read more >62. Changelog — AGX Dynamics 2.34.0.3 documentation
Changelog for older versions. 62.1. Version 2.34.0.3 (2022-11-11)¶. Patch release. Changes/Fixes.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@datumbox no strong reason, hasattr works, I think in this case there wouldn’t be any dir gotchas as it’s a enum in a module, hasattr does have stronger guarantees re attrib resolution in all cases though
@rwightman Thanks for reporting. Is there any specific reason you propose checking in
dir()
instead of doinghasattr(Image, "Resampling")
?@vfdev-5 Thanks for the ultra fast fix. I left this comment on the PR. I’ve tested with SIMD, PIL 9.0 and 9.1 and it works. Let me know what you think, thanks!