-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Warn if torchvision imported from repo root #2759
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
Conversation
6b9d93b
to
9af65a7
Compare
This is likely to fail as mentioned in pytorch#2239
9af65a7
to
e72c037
Compare
Codecov Report
@@ Coverage Diff @@
## master #2759 +/- ##
==========================================
- Coverage 73.22% 72.97% -0.26%
==========================================
Files 96 96
Lines 8431 8325 -106
Branches 1317 1296 -21
==========================================
- Hits 6174 6075 -99
+ Misses 1857 1850 -7
Partials 400 400
Continue to review full report at Codecov.
|
Hi @jamt9000, thanks for this contribution! My only comment here is that we should rather check for the existence of the compiled files |
Maybe you can use this call to importlib to find it: vision/torchvision/io/image.py Line 17 in 217e26f
|
@andfoy It looks like torchvision checks for _C.so already vision/torchvision/extension.py Lines 16 to 19 in 7a36388
vision/torchvision/extension.py Lines 23 to 27 in 7a36388
and can continue with reduced functionality if it is missing. Maybe it should always show a warning when _HAS_OPS = False (which could be for several reasons) and then also |
and I agree with @andfoy , we should instead check for the existence of the |
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.
* Warn if torchvision imported from repo root This is likely to fail as mentioned in pytorch#2239 * Only warn if ops are missing
* Warn if torchvision imported from repo root This is likely to fail as mentioned in pytorch#2239 * Only warn if ops are missing
Suggested fix for #2239
(Should it be an error or are there cases where it would be desired during development?)