AI软件下载
有趣网站推荐及实用软件下载

ONNXRuntimeError fail 'CUDAExecutionProvider'] and retrying.CUDA wasnt able to be loaded.解决方法

python应用运行报错,部分报错信息如下:

7920475 [E:onnxruntime:Default, provider_bridge_ort.cc:1744 onnxruntime::TryGetProviderInfo_CUDA] C:\a_work\1\s\onnxruntime\core\session\provider_bridge_ort.cc:1426 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError] : 1 : FAIL : LoadLibrary failed with error 126 “” when trying to load “lib\site-packages\onnxruntime\capi\onnxruntime_providers_cuda.dll”

EP Error C:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:866 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they’re in the PATH, and that your GPU is supported.
when using [‘CUDAExecutionProvider’, ‘CPUExecutionProvider’]
Falling back to [‘CUDAExecutionProvider’, ‘CPUExecutionProvider’] and retrying.

RuntimeError: C:\a_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:866 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please install the correct version of CUDA andcuDNN as mentioned in the GPU requirements page (https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements), make sure they’re in the PATH, and that your GPU is supported.

这是onnxruntime调用CUDA失败导致的错误,主要是onnxruntime的问题,解决方法如下:

你的python环境里应该也没有安装optimum,按下面步骤操作即可

先运行命令卸载onnxruntime-gpu

pip uninstall onnxruntime-gpu

如果你安装的是onnxruntime的话,那就把onnxruntime卸载,然后运行下面命令安装optimum

pip install optimum[onnxruntime-gpu]

这个过程会同时将evaluate,onnxruntime-gpu,optimum安装上去,重新运行python应用的话就没有这个CUDA报错了。

onnxruntime_providers_cuda.dll相关报错解决方法看另一篇文章《python报错[ONNXRuntimeError] : FAIL : LoadLibrary failed with error “\capi\onnxruntime_providers_cuda.dll”解决方法


AI软件用不了?2元爽玩4090: 立即体验>>

热门大语言模型API免费体验: 立即获取>>

软件催更及1对1人工答疑支持: https://nuowa.net/1806
赞(0) 打赏
软件无法使用?点击查看常见问题说明>>

最近更新

祝贺凡人修仙传2026年新年番开播同时在线人数超64万-诺瓦小站

祝贺凡人修仙传2026年新年番开播同时在线人数超64万

今天6月13日凡人修仙传新年番开播,同时在线人数破64万(非最高在线人数,只是我看到的在线人数),作为凡人5年老粉,必须发个帖祝贺一下。 我比较喜欢看动漫,各种类型看了很多,具体不清楚多少,像斗罗斗破之类看了一大半终究是没能看下去,还是雾山...

Claude居然自称“本人”-诺瓦小站

Claude居然自称“本人”

今天在和Claude聊网文写作的时候,Claude回复中居然自称本人,这让我有点震惊。 我经常会和AI聊工具功能对比等话题,ChatGPT、Gemini、Claude这些以前我记得从来没有自称过本人的,好像都是本模型,本工具等等,反正从来没...

免费在线HTML转markdown工具

经常看一些在线文档,想复制给AI参考的话不方便直接复制,转换成markdown再给AI阅读会更简单明了,也方便自己查阅,这里给大家推荐两个在线的免费HTML转markdown网站。 1、https://d1tools.com/tools/c...

觉得文章对你有帮助就打赏一下作者

非常感谢你的打赏,我将有更多的动力继续提供优质内容,让我们一起创建更加美好的世界!

支付宝扫一扫

微信扫一扫