Skip to content

Instantly share code, notes, and snippets.

@AnshMittal1811
Forked from ameya98/install_PyG.py
Created January 13, 2022 01:57
Show Gist options
  • Save AnshMittal1811/84d2fe96189e9eef683eaa09c45f8b85 to your computer and use it in GitHub Desktop.
Save AnshMittal1811/84d2fe96189e9eef683eaa09c45f8b85 to your computer and use it in GitHub Desktop.
Google Colab: PyTorch Geometric Installation
# 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
@AnshMittal1811
Copy link
Author

Can be used for Pytorch Graph Learning environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment