Skip to content

Commit e9dea72

Browse files
westfishluyao15
authored andcommitted
update
1 parent 91d2f5f commit e9dea72

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

ppdiffusers/examples/dreambooth/README_sd3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ python train_dreambooth_sd3.py \
4848
--report_to="wandb" \
4949
--lr_scheduler="constant" \
5050
--lr_warmup_steps=0 \
51-
--max_train_steps=500 \
51+
--max_train_steps=50 \
5252
--validation_prompt="A photo of sks dog in a bucket" \
5353
--validation_epochs=25 \
5454
--seed="0" \
5555
--checkpointing_steps=250
5656
```
5757

58-
为了更好地跟踪我们的训练实验,我们在上面的命令中使用了以下标志:
58+
fp16训练需要显存47000MiB,为了更好地跟踪我们的训练实验,我们在上面的命令中使用了以下标志:
5959

6060
* `report_to="wandb"` 将确保在 Weights and Biases 上跟踪训练运行。要使用它,请确保安装 `wandb`,使用 `pip install wandb`
6161
* `validation_prompt``validation_epochs` 允许脚本进行几次验证推理运行。这可以让我们定性地检查训练是否按预期进行。
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
Pillow
2-
ppdiffusers>=0.24.1
32
wandb

ppdiffusers/examples/dreambooth/train_dreambooth_lora_sd3.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,9 @@ def get_state_dict(model):
15101510
del text_encoder_one, text_encoder_two, text_encoder_three
15111511
gc.collect()
15121512
paddle.device.cuda.empty_cache()
1513+
1514+
if global_step >= args.max_train_steps:
1515+
break
15131516

15141517
# Save the lora layers
15151518
accelerator.wait_for_everyone()

ppdiffusers/examples/dreambooth/train_dreambooth_sd3.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,9 @@ def get_state_dict(model):
15781578
gc.collect()
15791579
paddle.device.cuda.empty_cache()
15801580

1581-
# Save the lora layers
1581+
if global_step >= args.max_train_steps:
1582+
break
1583+
15821584
accelerator.wait_for_everyone()
15831585
if accelerator.is_main_process:
15841586
transformer = unwrap_model(transformer)

ppdiffusers/ppdiffusers/loaders/lora.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ class SD3LoraLoaderMixin:
14831483
num_fused_loras = 0
14841484

14851485
def load_lora_weights(
1486-
self, pretrained_model_name_or_path_or_dict: Union[str, Dict[str, torch.Tensor]], adapter_name=None, **kwargs
1486+
self, pretrained_model_name_or_path_or_dict: Union[str, Dict[str, paddle.Tensor]], adapter_name=None, **kwargs
14871487
):
14881488
"""
14891489
Load LoRA weights specified in `pretrained_model_name_or_path_or_dict` into `self.unet` and
@@ -1781,7 +1781,7 @@ def pack_weights(layers, prefix):
17811781

17821782
@staticmethod
17831783
def write_lora_layers(
1784-
state_dict: Dict[str, torch.Tensor],
1784+
state_dict: Dict[str, paddle.Tensor],
17851785
save_directory: str,
17861786
is_main_process: bool,
17871787
weight_name: str,

0 commit comments

Comments
 (0)