繁体   English   中英

PyTorch + CUDA 7.5 错误

[英]PyTorch + CUDA 7.5 error

我对安装了 NVIDIA GPU 和 CUDA 7.5 的机器具有非 sudo 访问权限。 我安装了支持 CUDA 7.5 的 PyTorch,这似乎奏效了:

>>> import torch
>>> torch.cuda.is_available()
True

为了得到一些练习,我遵循了使用 RNN 进行机器翻译的教程 当我设置USE_CUDA = False并使用 CPU 时,一切正常。 但是,当想要使用USE_CUDA = True的 GPU 时,我收到以下错误:

Traceback (most recent call last):
  ...
  File "seq2seq.py", line 229, in train
    encoder_output, encoder_hidden = encoder(input_variable[ei], encoder_hidden)
  File "/.../python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "seq2seq.py", line 144, in forward
    output, hidden = self.gru(embedded, hidden)
  File "/.../python2.7/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/.../python2.7/site-packages/torch/nn/modules/rnn.py", line 91, in forward
    output, hidden = func(input, self.all_weights, hx)
  ...  
  File "/.../python2.7/site-packages/torch/backends/cudnn/rnn.py", line 42, in init_rnn_descriptor
    cudnn.DropoutDescriptor(handle, dropout_p, fn.dropout_seed)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: python: undefined symbol: cudnnCreateDropoutDescriptor
Exception AttributeError: 'python: undefined symbol: cudnnDestroyDropoutDescriptor' in <bound method DropoutDescriptor.__del__ of <torch.backends.cudnn.DropoutDescriptor object at 0x7fe540efec10>> ignored

我尝试使用 Google 搜索该错误,但没有得到任何有意义的结果。 由于我是 PyTorch 和 CUDA 的新手,我不知道如何从这里继续。 完整的设置是 Ubuntu 14.04、Python 2.7、CUDA 7.5。

如评论中所述:您的错误是过时的 CUDNN,可以通过升级解决。

安装当前版本的 CUDA、CUDNN 和 PyTorch,然后就可以了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM