question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created a year ago
  • Reactions:1
  • Comments:23 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
rwightmancommented, Jun 10, 2022

@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

1reaction
datumboxcommented, Jun 10, 2022

@rwightman Thanks for reporting. Is there any specific reason you propose checking in dir() instead of doing hasattr(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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found