It was saying “Found too old version of NVIDIA”. I tried all the possibilities, changed my CUDA version PyTorch version nothing helped. I got rid of cuda(). It certainly made my code slow but it works fine now.