RuntimeError: D:\a\_work\1\s\onnxruntime\python\onnxruntime_pybind_state.cc:857 onnxruntime::python::CreateExecutionProviderInstance CUDA_PATH is set but CUDA wasnt able to be loaded. Please ins

该报错通常出现在 Kohya SS 的 sd3‑flux.1 分支使用 WD14 tagger 时,因 onnxruntime‑gpu 版本与 CUDA 版本不匹配导致。优先排查 onnxruntime‑gpu 版本是否为 1.17.1 并升级至 1.19.2。

快速结论:该报错通常出现在 Kohya SS 的 sd3‑flux.1 分支使用 WD14 tagger 时,因 onnxruntime‑gpu 版本与 CUDA 版本不匹配导致。优先排查 onnxruntime‑gpu 版本是否为 1.17.1 并升级至 1.19.2。

适用环境:Kohya SS sd3‑flux.1 分支,Windows 系统,CUDA 12(由 PyTorch 引入),onnxruntime‑gpu 1.17.1。

最快修复方案:编辑项目根目录下的 requirements_windows.txt,将 onnxruntime-gpu==1.17.1 改为 onnxruntime-gpu==1.19.2,保存后重新启动 Kohya SS(或重新安装依赖)。该方案已在 Issue 中被用户验证有效,且已被维护者合入最新提交。

注意事项:该修复仅针对 sd3‑flux.1 旧分支,当前 master 分支已无此问题。若在 master 分支遇到类似错误,请检查 CUDA 与 onnxruntime 版本是否匹配。

问题场景

用户在 Kohya SS

参考来源

bmaltais/kohya_ss #2936

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

这个方案解决了吗?

celebrityanime
celebrityanime
文章: 15877

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注