-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add timm version check #1487
Add timm version check #1487
Conversation
FYI @adamjstewart. Would this fix the problem in torchgeo? |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1487 +/- ##
==========================================
- Coverage 84.40% 84.40% -0.01%
==========================================
Files 139 140 +1
Lines 5777 5783 +6
==========================================
+ Hits 4876 4881 +5
- Misses 901 902 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The try-except is probably overkill if you want to simplify things. Thanks for addressing this so quickly!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes. Everything looks good. I have a few suggestions:
- We should add an explicit version for packaging in the minimal requirements (suggestion in comment).
- Since we use now a lib for version comparison we should get rid of the old code we wrote ourselves in the past: https://github.com/lightly-ai/lightly/blob/master/lightly/utils/version_compare.py. I'd do it in the same PR to avoid any tech debt for later and to make sure the new code really works as it should.
Packaging is no longer needed now right? |
Yes exactly :) Plus we actually verify whether the required classes are there instead of relying on the version. The change should also speed up importing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me now! The edited test file passes and correctly skips certain tests because I have timm 0.9.2 installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This updated version is much more elegant and solves our need without new dependencies! Well done!
Thanks for the quick fix @guarin, glad we'll be able to use future timm versions again! |
Changes
This fixes import issues if users have an older version of timm installed. For details see: