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免费积分,开启AI创作之旅:速领>>

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

最近更新

免费在线视频去水印工具方法-诺瓦小站

免费在线视频去水印工具方法

本次分享一个免费的在线视频去水印工具–记灵 这个在线工具目前是完全免费的,上传mp4视频文件,然后鼠标框选去水印区域,然后点击处理等待处理完成就可以了,操作非常简单。 这个去水印工具是采用打码的方式覆盖原水印区域的,并不是AI智...

Unreal Engine 5恐怖游戏设计制作教程,从入门到精通从零开始完整项目开发详细讲解,中英文字幕-诺瓦小站

Unreal Engine 5恐怖游戏设计制作教程,从入门到精通从零开始完整项目开发详细讲解,中英文字幕

和大家分享一个以前收集的UE5虚幻引擎恐怖游戏开发教程,这是国外一个大神制作的视频教程,教程从零开始到制作出一款完整的游戏。内容讲解全面,如蓝图基础知识讲解、角色控制、高级交互系统、高级库存系统、物品检查、恐怖环境氛围设计、过场动画、AI系...

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

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

支付宝扫一扫

微信扫一扫