pyg-team / pytorch_geometric

Graph Neural Network Library for PyTorch
https://pyg.org
MIT License
21.09k stars 3.63k forks source link

How can I install pyG(version 1.4.3) with pytorch 1.4.0 ? Please help me !!! #4370

Open YGGlin opened 2 years ago

YGGlin commented 2 years ago

😵 Describe the installation problem

I create an virtual environment named pt140 for installation with python 3.7, and I have installed pytorch 1.4.0 with conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch.

I ran command nvcc -V, it shows that: Cuda compilation tools, release 9.0, V9.0.176, and nvidia-smi shows that: CUDA Version: 11.2, after pytorch has been installed, import torch; print(torch.version.cuda) shows that 10.1.

Now I want to install pytorch-geometric 1.4.3 for my experiment, I check the document of version 1.4.3 (https://pytorch-geometric.readthedocs.io/en/1.4.3/notes/installation.html) and I found that these command may install pytorch-geometric of the latest version (2.0.4), that's not what I want !

$ pip install torch-scatter==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.4.0.html
$ pip install torch-sparse==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.4.0.html
$ pip install torch-cluster==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.4.0.html
$ pip install torch-spline-conv==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.4.0.html
$ python setup.py install or pip install pytorch-geometric

and I found that there are so many versions of torch-scatter, torch-sparse, torch-cluster, torch-spline-conv for choose if I download wheels to install manually (from https://pytorch-geometric.com/whl/torch-1.4.0.html), I don't know how to choose these wheels and finally install pytorch-geometric with version 1.4.3 successfully...

So can you help me with the installation? How can I install pytorch-geometric with version 1.4.3? ! It would be great if you could help me! Thank you very much !!!

Environment

rusty1s commented 2 years ago

Simply running pip install torch-geometric==1.4.3 should do the trick. Let me know if this works :)

import torch_geometric
print(torch_geometric.__version__)
YGGlin commented 2 years ago

@rusty1s yes, it works! I firstly ran pip install torch-geometric==1.4.3, and then when I use pyG, it reported: no module named torch-scatter, then I installed the latest version of torch-scatter, torch-sparse, torch-cluster, torch-spline-conv that I downloaded before manually, pyG finally works perfectly on my experiment! thank you so much~ wish you a good day