-
Notifications
You must be signed in to change notification settings - Fork 7k
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
CPU package depends on non-CPU torch package #2310
Comments
Thanks for opening the issue! cc @seemethere @peterjc123 could you have a look at this? |
The way the dependency works is that it states that the That can refer to With conda this is a bit easier since there is a dependency workaround we use to designate different CUDA versions / CPU, but unfortunately that workaround does not work with python wheels. If you do note, our official documentation for installation asks you to specify that you explicitly want the CPU version when installing both
Technically with the way that |
Thanks for the reply. I'll investigate and try opening an issue at poetry. |
This may also be related to pytorch/pytorch#39779 |
Related yes but a separate problem. I opened pytorch/pytorch#39779 for that |
oh haha,I guess I should've noticed that you also filed that originally! |
From PEP 440 under Version matching
Following Poetry's debug output, it first adds the constraints from pyproject.toml, then reads the METADATA file in the torchvision wheel, and adds the constraint Given the above line from the PEP, that constraint can only be solved by ignoring the local version identifier. How "ignoring" is to be interpreted is not entirely clear to me (is any local identifier acceptable or should it be absent?), but I guess poetry takes it as "there can't be a local version identifier", because the constraint in the METADATA file requires an exact match ( Having said that, I also wanted to respond to something you said earlier:
As far as I am aware, pip doesn't have a (constraint-based) solver. It just installs dependencies one by one. Anyway, I'll open an issue at poetry and see what they have to say. |
Created python-poetry/poetry#2543, let's see what their thoughts are. |
I met the same problem. Any solution now? |
No response from maintainers yet on the poetry side, just other people chiming in with the same issue/duplicates. No change in pytorch/torch vision side yet either. |
I've added a workaround in python-poetry/poetry#2543 (comment) |
I've reached the conclusion that the problem lies with poetry's dependency resolver which appears not to be fully compliant with PEP440. Check out python-poetry/poetry#2543 |
🐛 Bug
The torch-vision CPU wheel depends on the non-CPU torch wheel
Evidence:
torchvision-0.6.0+cpu-cp36-cp36m-linux_x86_64.whl\torchvision-0.6.0+cpu.dist-info\METADATA
:To Reproduce
I've run into this with the poetry package manager for version 1.4.0 and 0.5.0, but the issue is also present in newer versions as can be seen in the previous snippet.
Note that I also had to work around another issue just to get poetry to find these packages since they are not on PyPI. See pytorch/pytorch#39779
Expected behavior
I would expect the CPU wheel for torchvision to depend on the CPU version for torch.
The text was updated successfully, but these errors were encountered: