rnn.cuda()->RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

问题描述:

系统: ubuntu 18
显卡: RTX2080
cuda10.0
python3.6.8
torch1.1

To Reproduce:

import torch
rnn = torch.nn.LSTM(10,10)  # same error with e.g. torch.nn.GRU(10,10,1)
rnn.cuda()

报错

Traceback (most recent call last):
File "", line 1, in 
File "/data/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 260, in cuda
return self._apply(lambda t: t.cuda(device))
File "/data/pytorch/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 117, in _apply
self.flatten_parameters()
File "/data/pytorch/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 113, in flatten_parameters
self.batch_first, bool(self.bidirectional))
RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

解决方案:

torch版本不对

别管对不对,重新下载一次

https://pytorch.org/get-started/locally/

你可能感兴趣的:(rnn.cuda()->RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED)