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
相关推荐
AI极客菌15 小时前
Stable Diffusion绘画 | 生成高清多细节图片的各个要素
人工智能·ai·ai作画·stable diffusion·aigc·midjourney·人工智能作画
灵魂画师向阳21 小时前
AI绘画Stable Diffusion 自制素材工具: layerdiffusion插件—你的透明背景图片生成工具
ai作画·stable diffusion·ai绘画·抠图·ai绘画教程·透明背景·sd教程
洋葱蚯蚓1 天前
构建自己的文生图工具:Python + Stable Diffusion + CUDA
开发语言·python·stable diffusion
Everglowwwwww2 天前
【bug】通过lora方式微调sdxl inpainting踩坑
学习·计算机视觉·ai作画·stable diffusion·bug
AI绘画咪酱2 天前
Stable Diffusion上手绘图必须知道的几个关键点,快收藏起来!
人工智能·ai作画·stable diffusion·aigc·ai绘画
蜡笔新小2 天前
Stable diffusion 学习过程
人工智能·学习·stable diffusion
SharpCJ3 天前
ComfyUI 基础教程(五) —— 应用 IP-Adapter 实现图像风格迁移
stable diffusion·aigc·comfyui
AI完全体3 天前
【AI小项目5】使用 KerasNLP 对 Gemma 模型进行 LoRA 微调
人工智能·lora·微调·nlp·大语言模型·gemma·kerasnlp
清图5 天前
智能营销才是营销的未来
人工智能·chatgpt·ai作画·stable diffusion·aigc·dall·e 2·ai-native
python零基础入门小白7 天前
Stable Diffusion4.9(Ai绘画)安装教程(永久许可)
stable diffusion·aigc