Since you are using a PyTorch, CUDA, and cudnn release from early 2018, you might be facing already fixed issues.
In any case, if you want to use this old setup, you could disable cudnn via torch.backends.cudnn.enabled = False and see, if your script would be working.