Cudnn dependency error when running yolov5

Traceback (most recent call last):
File “gen_wts.py”, line 1, in
from utils.utils import *
File “/home/mec/Downloads/demo/yolov5-master/yolov5-master/utils/utils.py”, line 17, in
import torch
File “/usr/local/lib/python3.6/dist-packages/torch/init.py”, line 136, in
from torch._C import *
ImportError: /usr/local/lib/python3.6/dist-packages/torch/lib/libtorch_cuda.so: symbol cudnnGetConvolutionBackwardDataAlgorithm version libcudnn.so.8 not defined in file libcudnn.so.8 with link time reference