stable diffusion model训练遇到的问题【No module named ‘triton‘】

一天早晨过来,发现昨天还能跑的diffusion代码,突然出现了【No module named 'triton'】的问题,导致本就不富裕的显存和优化速度雪上加霜,因此好好探究了解决方案。

首先是原因,由于早晨过来发现【电脑重启】导致了【训练终止】(美好的心情从看到windows更新结束),基本可以判定是由于windows更新,以及所编译的triton的windows版本的原因,最终解决方案如下:

1、第一步,按顺序卸载triton、xformers、torch

bash 复制代码
pip uninstall triton
pip uninstall xformers
pip uninstall torch

2、第二步,利用huggingface上直接下载到本地的triton-2.0.0-cp310-cp310-win_amd64.whl进行pip安装,安装triton。具体的windows下编译好的triton的网址为 https://huggingface.co/datasets/ArrayCats/triton-2.0.0-cp310-cp310-win_amd64/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl

bash 复制代码
pip install triton-2.0.0-cp310-cp310-win_amd64.whl

3、第三步,安装xformers

bash 复制代码
pip install xformers

4、第四步,在安装triton时,下载的torch为cpu版本,无法运用cuda和xformers,因此根据卸载前的版本或者xformers的报错,安装对应版本的torch,我个人所需要的是torch==2.0.1+cu118,所以在pytorch官网的安装命令上进行了修改,指定了torch版本

bash 复制代码
pip3 install torch==2.0.1+cu118 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
相关推荐
Seeklike21 小时前
diffusers学习--stable diffusion的管线解析
人工智能·stable diffusion·diffusers
马甲是掉不了一点的<.<1 天前
Stable Diffusion 环境配置详细指南
stable diffusion·环境配置
软件测试-阿涛1 天前
【AI绘画】Stable Diffusion webUI 常用功能使用技巧
人工智能·深度学习·计算机视觉·ai作画·stable diffusion
m0_603888712 天前
Stable Diffusion Models are Secretly Good at Visual In-Context Learning
人工智能·ai·stable diffusion·论文速览
爱分享的飘哥8 天前
第五十五章:AI模型的“专属定制”:LoRA微调原理与高效合并技巧
人工智能·lora·微调·ai训练·peft·代码实战·模型定制
谢白羽11 天前
tensorRT配合triton部署模型
yolo·tensorrt·onnx·triton
爱分享的飘哥14 天前
第三十七章:文生图的炼金术:Stable Diffusion完整工作流深度解析
人工智能·pytorch·stable diffusion·文生图·ai绘画·代码实战·cfg
EndingCoder17 天前
Three.js + AI:结合 Stable Diffusion 生成纹理贴图
开发语言·前端·javascript·人工智能·stable diffusion·ecmascript·three.js
那年一路北17 天前
Deforum Stable Diffusion,轻松实现AI视频生成自由!
人工智能·stable diffusion·音视频
全宝17 天前
🎨【AI绘画实战】从零搭建Stable Diffusion环境,手把手教你生成超可爱Q版大头照!
人工智能·python·stable diffusion