close

[Solved] RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED

Hello Guys, How are you all? Hope You all Are Fine. Today I am facing the following error RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED Error Occurs ?

I am just running my simple code. But it gives me the following error.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py", line 263, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/conv.py", line 260, in _conv_forward
    self.padding, self.dilation, self.groups)
RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED

How To Solve RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED Error ?

  1. How To Solve RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED Error ?

    To Solve RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED just downgrading to torch-1.7.1 and torchvision-0.8.2 it works just fine.

Solution 1: use cuda 11.1

By using Cuda 11.1 resolved my issue by just use the below command.

pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html

Solution 2: downgrading to torch-1.7.1

I am also using Cuda 10.2. I had the exact same error when upgrading torch and torchvision to the latest version (torch-1.8.0 and torchvision-0.9.0). Which version are you using?

I guess this is not the best solution but by downgrading to torch-1.7.1 and torchvision-0.8.2 it works just fine.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also Read

Leave a Comment