How to solve UserWarning

adajscas: <p>Recently reconfigured the YOLOv8 environment, cuda and pytorch versions are the same as before, and are matched, but there is this warning, I don’t know what the problem is, thank you</p>

ptrblck: <p>Without any information about the warning, it will be hard to help out, so could you share more information?</p>

adajscas: <p>sorry，I didn’t upload the photo successfully because of network problems</p>

adajscas: <p>Warnings are as follows：<br>
UserWarning: Plan failed with a cudnnException: CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR: cudnnFinalize Descriptor Failed cudnn_status: CUDNN_STATUS_NOT_SUPPORTED (Triggered internally at …\aten\src\ATen\native\cudnn\Conv_v8.cpp:919.)<br>
return Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass</p>

adajscas: <p>This warning appears after I added an Attention  called “CBAM”. I think cudnn can support to solve the Attention.What can I do? I really want to use cudnn.</p>

ptrblck: <aside class="quote no-group" data-username="adajscas" data-post="5" data-topic="203228">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/adajscas/48/70179_2.png" class="avatar"> adajscas:</div>
<blockquote>
<p>This warning appears after I added an Attention called “CBAM”. I</p>
</blockquote>
</aside>
<p>Try to narrow down what this modules does and if it’s calling into cuDNN. If so, try to isolate the failing call and post it here, please.</p>

adajscas: <p>this is the CBAM Attention，It adds spatial attention and channel attention on the basis of convolutio. But this is the official code of yolov8. I just called it.</p>
<pre><code class="lang-auto">class ChannelAttention(nn.Module):
    """Channel-attention module https://github.com/open-mmlab/mmdetection/tree/v3.0.0rc1/configs/rtmdet."""

    def __init__(self, channels: int) -&gt; None:
        """Initializes the class and sets the basic configurations and instance variables required."""
        super().__init__()
        self.pool = nn.AdaptiveAvgPool2d(1)
        self.fc = nn.Conv2d(channels, channels, 1, 1, 0, bias=True)
        self.act = nn.Sigmoid()

    def forward(self, x: torch.Tensor) -&gt; torch.Tensor:
        """Applies forward pass using activation on convolutions of the input, optionally using batch normalization."""
        return x * self.act(self.fc(self.pool(x)))


class SpatialAttention(nn.Module):
    """Spatial-attention module."""

    def __init__(self, kernel_size=7):
        """Initialize Spatial-attention module with kernel size argument."""
        super().__init__()
        assert kernel_size in {3, 7}, "kernel size must be 3 or 7"
        padding = 3 if kernel_size == 7 else 1
        self.cv1 = nn.Conv2d(2, 1, kernel_size, padding=padding, bias=False)
        self.act = nn.Sigmoid()

    def forward(self, x):
        """Apply channel and spatial attention on input for feature recalibration."""
        return x * self.act(self.cv1(torch.cat([torch.mean(x, 1, keepdim=True), torch.max(x, 1, keepdim=True)[0]], 1)))


class CBAM(nn.Module):
    """Convolutional Block Attention Module."""

    def __init__(self, c1, kernel_size=7):
        """Initialize CBAM with given input channel (c1) and kernel size."""
        super().__init__()
        self.channel_attention = ChannelAttention(c1)
        self.spatial_attention = SpatialAttention(kernel_size)

    def forward(self, x):
        """Applies the forward pass through C1 module."""
        return self.spatial_attention(self.channel_attention(x))
</code></pre>

adajscas: <p>“CBAM” attention is built on pytorch, but when I ran this error on the GPU, the code came from the official YOLO, I didn’t change it, I just called it</p>