Running python -c "import torch; print(torch.__version__)" gives 1.6.0
Running python -c "import torch; print(torch.version.cuda)" gives 10.2.
Yet, with the following:
pip install torch-scatter==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-${TORCH}.html
pip install torch-sparse==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-${TORCH}.html
pip install torch-cluster==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-${TORCH}.html
pip install torch-spline-conv==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-${TORCH}.html
pip install torch-geometric
I can install only torch-geometric, while for the first 4 packages I get the following error:
...
File "/data/l989o/miniconda3/envs/spatial_uzh/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 290, in __init__
wheel_version = Version(wheel.version)
File "/data/l989o/miniconda3/envs/spatial_uzh/lib/python3.8/site-packages/pip/_vendor/packaging/version.py", line 298, in __init__
raise InvalidVersion("Invalid version: '{0}'".format(version))
pip._vendor.packaging.version.InvalidVersion: Invalid version: 'latest+cu102'
nvcc. Cuda works perfectly with torch, but I don't have nvcc (I am using a machine partly managed by the institute)nvidia-smi gives 10.2, but I can also use cuda 9.2 with torch, so yes, I guess I have multiple versions installed.It appears this is caused by pip 20.3, which was released today. The new version is stricter and is unable to parse the version string. See also: https://github.com/pypa/pip/issues/9188
Minimal reproduction for the error (requires packaging, which is vendored inside of pip):
>>> from pip._vendor.packaging.version import Version
>>> # "from packaging.version import Version" also works if packaging is installed separately
>>> Version("latest+cu102")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/.../python3.8/site-packages/pip/_vendor/packaging/version.py", line 298, in __init__
raise InvalidVersion("Invalid version: '{0}'".format(version))
pip._vendor.packaging.version.InvalidVersion: Invalid version: 'latest+cu102'
Short-term fixes that might help:
2.0.5+cu110 that can be parsed by packaging.version.Version.~~Current pinnings as of today (I only checked for torch 1.7.0):~
pip install torch-scatter==2.0.5+${CUDA} -f https://pytorch-geometric.com/whl/torch-${TORCH}.html
pip install torch-sparse==0.6.8+${CUDA} -f https://pytorch-geometric.com/whl/torch-${TORCH}.html
pip install torch-cluster==1.5.8+${CUDA} -f https://pytorch-geometric.com/whl/torch-${TORCH}.html
pip install torch-spline-conv==1.2.0+${CUDA} -f https://pytorch-geometric.com/whl/torch-${TORCH}.html
pip install torch-geometric
edit: Apologies, my pinning suggestion won't work. The wheel's metadata version (2.0.5) doesn't match the version specifier that includes the platform cpu/cu* tag (2.0.5+cpu). See the error below. The only solution that I see right now is to use pip==20.2.4 or so, until the packaging ecosystem can fix these problems.
ERROR: Requested torch-scatter==2.0.5+cpu from https://pytorch-geometric.com/whl/torch-1.7.0/torch_scatter-2.0.5%2Bcpu-cp38-cp38-linux_x86_64.whl has different version in metadata: '2.0.5'
I'm in the process of providing the correct metadata for pinned wheels. Not yet sure how to handle the latest version prefix. I think that one was very convenient.
This is now resolved. You can now install the packages via:
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-${TORCH}+${CUDA}.html
For example, for installing for PyTorch 1.7.0 with CUDA 11.0, type:
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv -f https://pytorch-geometric.com/whl/torch-torch-1.7.0+cu110.html
All "old" links are still intact. You can have a look at all possible combinations here.
Good solution, @rusty1s! Thanks again.
Thanks a lot @rusty1s
Only one thing, using those commands some of the wheels get's built on my machine and it takes somethings like 5-10 minutes. Is there a way to have them pre-built?
It should only built from source in case it cannot find a suitable wheel for your OS. Does
pip install https://pytorch-geometric.com/whl/torch-1.6.0%2Bcu102/torch_scatter-2.0.5-cp38-cp38-linux_x86_64.whl
work for you?
Understood. Yes it installs it immediately.
To install it I ran conda clean --all, and then I have run the following:
conda create -n test0 python=3.8
conda activate test0
conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.2 -c pytorch
pip <command that you posted>
I have also tried calling it with --no-cache-dir and again, the installation was immediate.
Most helpful comment
This is now resolved. You can now install the packages via:
For example, for installing for PyTorch 1.7.0 with CUDA 11.0, type:
All "old" links are still intact. You can have a look at all possible combinations here.