RuntimeError: CUDA error: no kernel image is available for execution on the device in the second GPU

Traceback (most recent call last):
File “train.py”, line 264, in
).to(device)
File “C:\Users\a.abdallah\Anaconda3\envs\ocr2\lib\site-packages\torch\nn\modules\module.py”, line 425, in to
return self._apply(convert)
File “C:\Users\a.abdallah\Anaconda3\envs\ocr2\lib\site-packages\torch\nn\modules\module.py”, line 201, in _apply
module._apply(fn)
File “C:\Users\a.abdallah\Anaconda3\envs\ocr2\lib\site-packages\torch\nn\modules\rnn.py”, line 140, in _apply
self.flatten_parameters()
File “C:\Users\a.abdallah\Anaconda3\envs\ocr2\lib\site-packages\torch\nn\modules\rnn.py”, line 129, in flatten_parameters
self.batch_first, bool(self.bidirectional))
RuntimeError: CUDA error: no kernel image is available for execution on the device

This error is raised if some CUDA code wasn’t compiled for the compute capability of your device.
How did you install PyTorch and which GPU are you using?

the error becuase i installed pytorch=1.5 and the code was wriiten in 1.4 i solved it thank

I’m running into similar issues while trying to use PyTorch 1.5. How did you solve it?