赞
踩
官方地址:GitHub - bmaltais/kohya_ss
尝试过mac和Ubuntu,装上后都会有问题
Windows按照官方步骤安装即可
- git clone https://github.com/bmaltais/kohya_ss.git
- cd kohya_ss
-
- python -m venv venv
- .\venv\Scripts\activate
-
- pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
- pip install --use-pep517 --upgrade -r requirements.txt
- pip install -U -I --no-deps https://github.com/C43H66N12O12S2/stable-diffusion-webui/releases/download/f/xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl
-
- cp .\bitsandbytes_windows\*.dll .\venv\Lib\site-packages\bitsandbytes\
- cp .\bitsandbytes_windows\cextension.py .\venv\Lib\site-packages\bitsandbytes\cextension.py
- cp .\bitsandbytes_windows\main.py .\venv\Lib\site-packages\bitsandbytes\cuda_setup\main.py
-
- accelerate config
- .\venv\Scripts\activate
-
- python .\tools\cudann_1.8_install.py
gui.bat
打tag
这里改一下
然后开始训练
安装扩展:GitHub - kohya-ss/sd-webui-additional-networks
使用时勾上
过程中如果报错,可能的原因
1、显存不足
2、模型没下载完
3、cuda没安装
进入虚拟环境后,执行
python -c "import torch; print(torch.cuda.is_available())"
结果为True说明已安装
下载地址:https://developer.nvidia.com/cuda-downloads
安装方法
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-ubuntu1604.pin sudo mv cuda-ubuntu1604.pin /etc/apt/preferences.d/cuda-repository-pin-600 sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/ /" sudo apt-get update sudo apt-get -y install cuda
下载地址:https://developer.nvidia.com/rdp/cudnn-archive
安装方法
sudo dpkg -i cudnn-local-repo-ubuntu1804-8.8.1.3_1.0-1_amd64.deb
下载地址:https://developer.nvidia.com/nccl/nccl-legacy-downloads
安装方法
sudo dpkg -i nccl-local-repo-ubuntu1804-2.8.4-cuda11.2_1.0-1_amd64.deb
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。