Skip to content

Commit

Permalink
[DreamBooth] Set train mode for text encoder (open-mmlab#1012)
Browse files Browse the repository at this point in the history
Set train mode for text encoder
  • Loading branch information
duongna21 committed Oct 27, 2022
1 parent abe0582 commit 4623f09
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/dreambooth/train_dreambooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,8 @@ def collate_fn(examples):

for epoch in range(args.num_train_epochs):
unet.train()
if args.train_text_encoder:
text_encoder.train()
for step, batch in enumerate(train_dataloader):
with accelerator.accumulate(unet):
# Convert images to latent space
Expand Down

0 comments on commit 4623f09

Please sign in to comment.