I was working on a PyTorch Geometric project using Google Colab for CUDA support. Since it's library isn't present by default, I run:
!pip install --upgrade torch-scatter
!pip install --upgrade torch-sparse
!pip install --upgrade torch-cluster
!pip install --upgrade torch-spline-conv
!pip install torch-geometric
Recently, while importing torch_geometric, owing to version upgrades, there's a CUDA version mismatch saying:
RuntimeError: Detected that PyTorch and torch_sparse were compiled with different CUDA versions. PyTorch has CUDA version 10.1 and torch_sparse has CUDA version 10.0. Please reinstall the torch_sparse that matches your PyTorch install.
To solve this, I tried using conda for specific CUDA version as:
!conda install pytorch==1.4.0 cudatoolkit=10.0 -c pytorch
Yet, on running print(torch.version.cuda)
, I get 10.1 as the output and not 10.0 as I wanted.
This is a recent error since it wasn't throwing up this issue in past week. Any best practice to solve this issue?