-
-
Save ameya98/b193856171d11d37ada46458f60e73e7 to your computer and use it in GitHub Desktop.
# Add this in a Google Colab cell to install the correct version of Pytorch Geometric. | |
import torch | |
def format_pytorch_version(version): | |
return version.split('+')[0] | |
TORCH_version = torch.__version__ | |
TORCH = format_pytorch_version(TORCH_version) | |
def format_cuda_version(version): | |
return 'cu' + version.replace('.', '') | |
CUDA_version = torch.version.cuda | |
CUDA = format_cuda_version(CUDA_version) | |
!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 | |
!pip install torch-geometric |
Not sure I understand, is something not working? @ali1810
Thank you! Works perfectly!
I found only this worked, and it worked in under 5x the time:
!pip install -q torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
!pip install -q torch-sparse -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
!pip install -q torch-cluster -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
!pip install -q torch-geometric
I found only this worked, and it worked in under 5x the time:
!pip install -q torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
!pip install -q torch-sparse -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
!pip install -q torch-cluster -f https://pytorch-geometric.com/whl/torch-1.9.0+cu102.html
!pip install -q torch-geometric
@homerjed Works well:+1:
Thanks @homerjed! Let me try to see if there's a way that will automatically find the latest package versions.
It worked for me. Thank you
This was massively helpful. Thanks!
Colab has updated its cuda version recently, and ALL the solutions above seem DO NOT WORK.
TRY THIS ONE
# Add this in a Google Colab cell to install the correct version of Pytorch Geometric.
import torch
def format_pytorch_version(version):
return version.split('+')[0]
TORCH_version = torch.__version__
TORCH = format_pytorch_version(TORCH_version)
def format_cuda_version(version):
return 'cu' + version.replace('.', '')
CUDA_version = torch.version.cuda
CUDA = format_cuda_version(CUDA_version)
!pip install torch-scatter -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-sparse -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-cluster -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-spline-conv -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-geometric
That also did not work with me,
I received this error OSError: libcudart.so.10.2: cannot open shared object file: No such file or directory
Works for me. Thank you.
@Jiayi-Pan's code still works today. Thanks!
Code works fine. Thank you!
This was very helpful! Still works today!
Colab has updated its cuda version recently, and ALL the solutions above seem DO NOT WORK. TRY THIS ONE
# Add this in a Google Colab cell to install the correct version of Pytorch Geometric. import torch def format_pytorch_version(version): return version.split('+')[0] TORCH_version = torch.__version__ TORCH = format_pytorch_version(TORCH_version) def format_cuda_version(version): return 'cu' + version.replace('.', '') CUDA_version = torch.version.cuda CUDA = format_cuda_version(CUDA_version) !pip install torch-scatter -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-sparse -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-cluster -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-spline-conv -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-geometric
This is not working currently on google colab. Can anyone help me out? Thanks in advance.
Add this in a Google Colab cell to install the correct version of Pytorch Geometric.
import torch
def format_pytorch_version(version):
return version.split('+')[0]TORCH_version = torch.version
TORCH = format_pytorch_version(TORCH_version)def format_cuda_version(version):
return 'cu' + version.replace('.', '')CUDA_version = torch.version.cuda
CUDA = format_cuda_version(CUDA_version)!pip install torch-scatter -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-sparse -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-cluster -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-spline-conv -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html
!pip install torch-geometric
Hi, it still works fine on my side at Colab as 2022/5/14.
Colab has updated its cuda version recently, and ALL the solutions above seem DO NOT WORK. TRY THIS ONE
# Add this in a Google Colab cell to install the correct version of Pytorch Geometric. import torch def format_pytorch_version(version): return version.split('+')[0] TORCH_version = torch.__version__ TORCH = format_pytorch_version(TORCH_version) def format_cuda_version(version): return 'cu' + version.replace('.', '') CUDA_version = torch.version.cuda CUDA = format_cuda_version(CUDA_version) !pip install torch-scatter -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-sparse -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-cluster -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-spline-conv -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-geometric
Works! Thanks a lot!
Works. Cool!
Colab has updated its cuda version recently, and ALL the solutions above seem DO NOT WORK. TRY THIS ONE
# Add this in a Google Colab cell to install the correct version of Pytorch Geometric. import torch def format_pytorch_version(version): return version.split('+')[0] TORCH_version = torch.__version__ TORCH = format_pytorch_version(TORCH_version) def format_cuda_version(version): return 'cu' + version.replace('.', '') CUDA_version = torch.version.cuda CUDA = format_cuda_version(CUDA_version) !pip install torch-scatter -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-sparse -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-cluster -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-spline-conv -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html !pip install torch-geometric
Works like a charm, thanks - installation time down from 33min to 36sec.
Same here, worked well for me!
this worked for me in colab notebook:
!pip install torch-scatter -f https://data.pyg.org/whl/torch-2.4.0+cu121.html
but make sure that you have the same torch version as here: 2.4.0 ( because i have torch-2.4.0)
!pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
This works for me as I was having problem to solve the problem installing torch-scatter