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
相关推荐
Icoolkj7 小时前
深入了解 Stable Diffusion:AI 图像生成的奥秘
人工智能·stable diffusion
太空眼睛9 小时前
【LLaMA-Factory】使用LoRa微调训练DeepSeek-R1-Distill-Qwen-7B
lora·微调·sft·训练·deepspeed·llama-factory·deepseek
这是一个懒人19 小时前
mac 快速安装stable diffusion webui
macos·stable diffusion
璇转的鱼1 天前
Stable Diffusion进阶之Controlnet插件使用
人工智能·ai作画·stable diffusion·aigc·ai绘画
AloneCat20122 天前
stable Diffusion模型结构
stable diffusion
西西弗Sisyphus2 天前
Stable Diffusion XL 文生图
stable diffusion
Ronin-Lotus2 天前
嵌入式硬件篇---无线通信模块
嵌入式硬件·wifi·lora·无线通信·蓝牙·2.4g射频
霍志杰3 天前
stable-diffusion windows本地部署
windows·stable diffusion
昨日之日20063 天前
ACE-Step - 20秒生成4分钟完整歌曲,音乐界的Stable Diffusion,支持50系显卡 本地一键整合包下载
计算机视觉·stable diffusion·音视频
白熊1884 天前
【图像大模型】Stable Diffusion Web UI:深度解析与实战指南
ui·stable diffusion