Last active
December 18, 2024 00:15
-
-
Save ameya98/b193856171d11d37ada46458f60e73e7 to your computer and use it in GitHub Desktop.
Google Colab: PyTorch Geometric Installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
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)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works like a charm, thanks - installation time down from 33min to 36sec.