XavierXiao / Dreambooth-Stable-Diffusion

Implementation of Dreambooth (https://arxiv.org/abs/2208.12242) with Stable Diffusion
MIT License
7.6k stars 795 forks source link

支持多GPU训练吗 #163

Open Vizzana opened 6 months ago

Vizzana commented 5 months ago

支持

CVerSMH commented 4 months ago

支持

你是怎么实现的? 我是用dp:model = nn.DataParallel(model),然后出现错误:AttributeError: 'LatentDiffusion' object has no attribute 'learning_rate'

Vizzana commented 4 months ago

训练: CUDA_VISIBLE_DEVICES=1,2 python main.py --base configs/stable-diffusion/v1-finetune_unfrozen.yaml -t --actual_resume ./models/sd-v1-4.ckpt -n myself --gpus 0 --data_root ./dreambooth-dataset/dataset/backpack --reg_data_root ./regularization_images/backpack/samples --class_word backpack --no-test --gradient_checkpointing True --use_8bit_adam True --fp16 fp16 --gradient_accumulation_steps 1 --train_batch_size 1

生图: CUDA_VISIBLE_DEVICES=2 python scripts/stable_txt2img.py --ddim_eta 0.0
--n_samples 3
--n_iter 1
--scale 10.0
--ddim_steps 2000
--ckpt ./logs/cat_statue2024-05-06T16-23-05_cat_sculpture/checkpoints/last.ckpt
--prompt "a sks cat in Tsinghua University"

印象里,我并没有对原来项目代码 做什么改动。