Colab Session Crashes on importing

My colab session always crashes while tring to import 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{TORCH}+{CUDA}.html

!pip install torch-sparse -f{TORCH}+{CUDA}.html

!pip install torch-cluster -f{TORCH}+{CUDA}.html

!pip install torch-spline-conv -f{TORCH}+{CUDA}.html

!pip install torch-geometric

!pip install torch_geometric

from 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

I did a little change in your code:

TORCH_version = torch.**version**


TORCH_version = torch.__version__

And it didn’t crash to me in Colab link

I hope I’ve helped