Colab Session Crashes on importing torch_geometric.data

My colab session always crashes while tring to import torch_geometric.data module. For reference, the code I am writing is as follows:

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

!pip install torch_geometric

from torch_geometric.data import Data << When the execution reaches this line, the colab session crashes, I have tried switching to GPU and TPU as well, but nothing happens.

The logs shows this: WARNING:root:kernel fc8fda2d-f1ce-4808-b78f-a18a55132346 restarted

Hi,
I did a little change in your code:
this:

TORCH_version = torch.**version**

by:

TORCH_version = torch.__version__

And it didn’t crash to me in Colab link

I hope I’ve helped