RuntimeError: cuDNN version incompatibility: PyTorch was compiled against (8, 5, 0) but found runti

在配置memsum环境时遇到RuntimeError,提示cuDNN版本与PyTorch编译版本不匹配。问题根源是LD_LIBRARY_PATH中包含了不匹配版本的cuDNN。解决方案是删除LD_LIBRARY_PATH中的冲突版本或者安装与PyTorch匹配的cuDNN(8.5.0)。简单地unsetLD_LIBRARY_PATH可以解决此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题

RuntimeError: cuDNN version incompatibility: PyTorch was compiled against (8, 5, 0) but found runtime version (8, 4, 1). PyTorch already comes bundled with cuDNN. One option to resolving this error is to ensure PyTorch can find the bundled cuDNN.Looks like your LD_LIBRARY_PATH contains incompatible version of cudnnPlease either remove it from the path or install cudnn (8, 5, 0)

在复现memsum,构建环境的时候,出现了这个问题,逛了一圈,问题出在pytorch和cudnn版本不对,可以从LD_LIBRARY_PATH解决问题

方法

unset LD_LIBRARY_PATH解决了我的问题

RuntimeError Traceback (most recent call last) RuntimeError: module compiled against API version 0xf but this version of numpy is 0xd --------------------------------------------------------------------------- ImportError Traceback (most recent call last) ImportError: numpy.core.multiarray failed to import The above exception was the direct cause of the following exception: SystemError Traceback (most recent call last) SystemError: <built-in method __contains__ of dict object at 0x00000270A8577F80> returned a result with an error set The above exception was the direct cause of the following exception: ImportError Traceback (most recent call last) <ipython-input-21-035b45420c6e> in <module> ----> 1 from model.build_mtcnn_model import create_Pnet, create_Rnet, create_Onet 2 import numpy as np 3 import cv2 4 5 ~\Desktop\第五课 实战案例:基于FaceNet的人脸智能识别 - 副本\(ppt、源代码、数据)数据&代码\数据&代码\基于FaceNet的人脸智能识别\model\build_mtcnn_model.py in <module> ----> 1 from tensorflow.keras.layers import Conv2D, Input, MaxPool2D, Flatten, Dense, Permute 2 from tensorflow.keras.layers import PReLU 3 from tensorflow.keras.models import Model 4 5 # -----------------------------# C:\StFiles\Anaconda\lib\site-packages\tensorflow\__init__.py in <module> 36 import typing as _typing 37 ---> 38 from tensorflow.python.tools import module_util as _module_util 39 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader 40 C:\StFiles\Anaconda\lib\site-packages\tensorflow\python\__init__.py in <module> 35 36 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow ---> 37 from tensorflow.python.eager import context 38 39 # pylint: enable=wildcard-import C:\StFiles\Anaconda\lib\site-packages\tensorflow\python\eager\context.py in <module> 32 from tensorflow.python
最新发布
03-29
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值