My Google Colab GPU doesn't get used even when I am connected to it. I'm trying to run a PyTorch model on Google Colab using the free GPU, but it seems that my code is still running on the CPU despite Colab detecting the GPU.
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(f"Using device: {device}")
The output I got to this as in the colab file was:
Using device: cuda
This is the link to my Colab file: Colab file
I am using the free version of T4 GPU and even am connected to the correct runtime. It is not only for this code, it's for every code that I have worked on since the past 6 months. Before that, the GPU was getting used fine.
I want to know if it's a problem with my version or if I have installed something wrong in my system.