Maybe you have no cudnn.Remeber to install the right Version!
Secondly,the version of CUDA may be different from the one needed by pytorch.
I got the same Error, now it goes right. I have no cudnn before.
Good luck!