添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

RuntimeError: cuDNN版本不匹配。PyTorch是针对7102编译的,但是针对7604链接的。

1 人关注

我在运行训练一个深度学习模型时遇到了这个错误,虽然在网上看了很多解决方案,但都没有帮助我。日志的内容如下。

Traceback (most recent call last):
  File "main.py", line 208, in <module>
    main()
  File "main.py", line 100, in main
    model = nn.DataParallel(model).cuda()
  File "/home/dexter/miniconda3/envs/VideoSum/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py", line 105, in __init__
    self.module.cuda(device_ids[0])
  File "/home/dexter/miniconda3/envs/VideoSum/lib/python3.5/site-packages/torch/nn/modules/module.py", line 249, in cuda
    return self._apply(lambda t: t.cuda(device))
  File "/home/dexter/miniconda3/envs/VideoSum/lib/python3.5/site-packages/torch/nn/modules/module.py", line 176, in _apply
    module._apply(fn)
  File "/home/dexter/miniconda3/envs/VideoSum/lib/python3.5/site-packages/torch/nn/modules/rnn.py", line 112, in _apply
    self.flatten_parameters()
  File "/home/dexter/miniconda3/envs/VideoSum/lib/python3.5/site-packages/torch/nn/modules/rnn.py", line 78, in flatten_parameters
    if not any_param.is_cuda or not torch.backends.cudnn.is_acceptable(any_param):
  File "/home/dexter/miniconda3/envs/VideoSum/lib/python3.5/site-packages/torch/backends/cudnn/__init__.py", line 87, in is_acceptable
    if _libcudnn() is None:
  File "/home/dexter/miniconda3/envs/VideoSum/lib/python3.5/site-packages/torch/backends/cudnn/__init__.py", line 58, in _libcudnn
    'but linked against {}'.format(compile_version, __cudnn_version))
RuntimeError: cuDNN version mismatch: PyTorch was compiled against 7102 but linked against 7604
    
python
deep-learning
pytorch
cudnn
Giang Nguyen
Giang Nguyen
发布于 2020-02-10
2 个回答
Giang Nguyen
Giang Nguyen
发布于 2020-05-01
已采纳
0 人赞同

问题是,无论日志中显示的版本是什么,7.6.4是我的cudnn版本,7.1.2是代码最初编译的cudnn版本。我需要的是通过以下方式降级(或升级我当前的cudnn版本)。

conda install cudnn=7.1.2

它是有效的,如果有的话,请纠正我。

RexBarker
RexBarker
发布于 2020-05-01
0 人赞同

我也有类似的问题......降级 cudnn 对我有用。 正如这里提到的,错误信息 【替换代码1