Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
677df5ac
Unverified
Commit
677df5ac
authored
Oct 23, 2023
by
Shyam Marjit
Committed by
GitHub
Oct 23, 2023
Browse files
fixed SDXL text encoder training bug #5016 (#5078)
Co-authored-by:
Sayak Paul
<
spsayakpaul@gmail.com
>
parent
16851efa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
examples/dreambooth/train_dreambooth_lora_sdxl.py
examples/dreambooth/train_dreambooth_lora_sdxl.py
+5
-0
No files found.
examples/dreambooth/train_dreambooth_lora_sdxl.py
View file @
677df5ac
...
...
@@ -1070,6 +1070,11 @@ def main(args):
if
args
.
train_text_encoder
:
text_encoder_one
.
train
()
text_encoder_two
.
train
()
# set top parameter requires_grad = True for gradient checkpointing works
text_encoder_one
.
text_model
.
embeddings
.
requires_grad_
(
True
)
text_encoder_two
.
text_model
.
embeddings
.
requires_grad_
(
True
)
for
step
,
batch
in
enumerate
(
train_dataloader
):
with
accelerator
.
accumulate
(
unet
):
pixel_values
=
batch
[
"pixel_values"
].
to
(
dtype
=
vae
.
dtype
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment