Did you change something else besides the PyTorch version?
What CUDA, cudnn, and PyTorch versions are you using now and which one raised this error?
Do you have a reproducible code snippet so that we could have a look?