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
相关推荐
多恩Stone2 天前
【Stable Diffusion 1.5 】在 Unet 中每个 Cross Attention 块中的张量变化过程
stable diffusion
今夕节度使2 天前
ARM架构推理Stable Diffusiond
stable diffusion
寻丶幽风5 天前
论文阅读笔记——FLOW MATCHING FOR GENERATIVE MODELING
论文阅读·人工智能·笔记·扩散模型·流匹配
远瞻。6 天前
【论文精读】2024 ECCV--MGLD-VSR现实世界视频超分辨率(RealWorld VSR)
人工智能·算法·stable diffusion·音视频·超分辨率重建
寻丶幽风7 天前
论文阅读笔记——In-Context Edit
论文阅读·人工智能·语言模型·lora·图像编辑·moe
远瞻。7 天前
【论文精读】2024 CVPR--Upscale-A-Video现实世界视频超分辨率(RealWorld VSR)
论文阅读·人工智能·算法·stable diffusion·音视频·超分辨率重建
乱世刀疤7 天前
AI绘画:手把手带你Stable Diffusion从入门到精通(系列教程)
人工智能·ai作画·stable diffusion
layneyao9 天前
从0到1搭建AI绘画模型:Stable Diffusion微调全流程避坑指南
ai作画·stable diffusion
远瞻。9 天前
【论文精读】2024 arXiv --VEnhancer现实世界视频超分辨率(RealWorld VSR)
论文阅读·stable diffusion·音视频·超分辨率重建
橙子小哥的代码世界11 天前
PET,Prompt Tuning,P Tuning,Lora,Qlora 大模型微调的简介
人工智能·lora·transformer·prompt tuning·模型训练·pturning