为了便于使用,构建一个docker镜像来使用秋叶包。2024年6月26日。
docker run -it --gpus all -v /ssd/xiedong:/datax --net host kevinchina/deeplearning:pytorch2.3.0-cuda12.1-cudnn8-devel-xformers bash
git clone --recurse-submodules https://github.com/Akegarasu/lora-scripts
cd /workspace/lora-scripts/sd-scripts
pip install --upgrade -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
cd /workspace/lora-scripts
pip install --upgrade -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
apt update
apt install libgl1-mesa-glx -y
apt install libglib2.0-0 -y
apt install vim -y
加入bashrc:
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64:$LD_LIBRARY_PATH
参数
# python gui.py --help
usage: gui.py [-h] [--host HOST] [--port PORT] [--listen] [--skip-prepare-environment] [--disable-tensorboard] [--disable-tageditor] [--tensorboard-host TENSORBOARD_HOST]
[--tensorboard-port TENSORBOARD_PORT] [--localization LOCALIZATION] [--dev]
GUI for stable diffusion training
options:
-h, --help show this help message and exit
--host HOST
--port PORT Port to run the server on
--listen
--skip-prepare-environment
--disable-tensorboard
--disable-tageditor
--tensorboard-host TENSORBOARD_HOST
Port to run the tensorboard
--tensorboard-port TENSORBOARD_PORT
Port to run the tensorboard
--localization LOCALIZATION
--dev
启动应用:
python gui.py --host "0.0.0.0" --port 7874 --tensorboard-host "0.0.0.0" --tensorboard-port 6007
标记 :
docker commit d30ded10b63a kevinchina/deeplearning:pytorch2.3.0-cuda12.1-cudnn8-devel-xformers-lora-train
docker push kevinchina/deeplearning:pytorch2.3.0-cuda12.1-cudnn8-devel-xformers-lora-train
OK 现在你只需要使用kevinchina/deeplearning:pytorch2.3.0-cuda12.1-cudnn8-devel-xformers-lora-train即可训练lora或者sd中其他模块,环境已经齐全。