<h5 dir="auto">System information (version)</h5>

<ul dir="auto">
<li>OpenCV =&gt; :4.4.0:</li>
<li>Operating System / Platform =&gt;  Ubuntu 20.04</li>
<li>Compiler =&gt;  GCC 8.4</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">I am loading a pre-trained SSD from TensorFlow and setting the target as preferred backend as CUDA. I am running Cuda 10.2 with cuDNN 8.0.2 and I have built OpenCV. Following code to load the model</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    cv::dnn::Net net = cv::dnn::readNetFromTensorflow(&quot;/Models/frozen_inference_graph.pb&quot;,
                                        &quot;/graph.pbtxt&quot;);
    net.setPreferableBackend(cv::dnn::DNN_BACKEND_CUDA); 
    net.setPreferableTarget(cv::dnn::DNN_TARGET_CUDA); "><pre class="notranslate"><code class="notranslate">    cv::dnn::Net net = cv::dnn::readNetFromTensorflow("/Models/frozen_inference_graph.pb",
                                        "/graph.pbtxt");
    net.setPreferableBackend(cv::dnn::DNN_BACKEND_CUDA); 
    net.setPreferableTarget(cv::dnn::DNN_TARGET_CUDA); 
</code></pre></div>
<p dir="auto">And I get the following error -</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="terminate called after throwing an instance of 'cv::dnn::cuda4dnn::csl::cudnn::cuDNNException'

what():  OpenCV(4.4.0) /home/atharva/opencv-4.4.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/convolution.hpp:420: error: (-217:Gpu API call) CUDNN_STATUS_BAD_PARAM in function 'convolve'"><pre class="notranslate"><code class="notranslate">terminate called after throwing an instance of 'cv::dnn::cuda4dnn::csl::cudnn::cuDNNException'

what():  OpenCV(4.4.0) /home/atharva/opencv-4.4.0/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/convolution.hpp:420: error: (-217:Gpu API call) CUDNN_STATUS_BAD_PARAM in function 'convolve'
</code></pre></div>
<p dir="auto">Could you please point what could be goig wrong?</p>


<h5 dir="auto">Issue submission checklist</h5>
<ul dir="auto">
<li>[ yes] I report the issue, it's not a question

</li>
<li>[yes ] I checked the problem with documentation, FAQ, open issues,<br>
answers.opencv.org, Stack Overflow, etc and have not found solution

</li>
<li>[ yes] I updated to latest OpenCV version and the issue is still there

</li>
<li>[ yes] There is reproducer code and related data files: videos, images, onnx, etc

</li>
</ul>
<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 4.4dev</li>
<li>Operating System / Platform =&gt; Ubuntu 18.04</li>
<li>Compiler =&gt; gcc 7.5</li>
<li>nVidia Driver: 450.57</li>
<li>CUDA: 11.0.194GA</li>
<li>cudnn: 8.0.2GA</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    cv2.error: OpenCV(4.4.0-dev) /source/opencv/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/convolution.hpp:420: error: (-217:Gpu API call) CUDNN_STATUS_BAD_PARAM in function 'convolve'"><pre class="notranslate"><code class="notranslate">    cv2.error: OpenCV(4.4.0-dev) /source/opencv/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/convolution.hpp:420: error: (-217:Gpu API call) CUDNN_STATUS_BAD_PARAM in function 'convolve'
</code></pre></div>
<h5 dir="auto">Steps to reproduce</h5>
<p dir="auto">running YOLOV4 model with this works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    net = cv2.dnn.readNet('yolov4.weights', 'yolov4.cfg')
    net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
    net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA_FP16)"><pre class="notranslate"><code class="notranslate">    net = cv2.dnn.readNet('yolov4.weights', 'yolov4.cfg')
    net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
    net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA_FP16)
</code></pre></div>
<p dir="auto">With this I get the error above</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    net = cv2.dnn.readNet('yolov4.weights', 'yolov4.cfg')
    net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
    net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)"><pre class="notranslate"><code class="notranslate">    net = cv2.dnn.readNet('yolov4.weights', 'yolov4.cfg')
    net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
    net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)
</code></pre></div>