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
df76a39e
Unverified
Commit
df76a39e
authored
Dec 22, 2023
by
apolinário
Committed by
GitHub
Dec 22, 2023
Browse files
Fix Prodigy optimizer in SDXL Dreambooth script (#6290)
* Fix ProdigyOPT in SDXL Dreambooth script * style * style
parent
3369bc81
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
examples/dreambooth/train_dreambooth_lora_sdxl.py
examples/dreambooth/train_dreambooth_lora_sdxl.py
+16
-0
No files found.
examples/dreambooth/train_dreambooth_lora_sdxl.py
View file @
df76a39e
...
@@ -1144,10 +1144,26 @@ def main(args):
...
@@ -1144,10 +1144,26 @@ def main(args):
optimizer_class
=
prodigyopt
.
Prodigy
optimizer_class
=
prodigyopt
.
Prodigy
if
args
.
learning_rate
<=
0.1
:
logger
.
warn
(
"Learning rate is too low. When using prodigy, it's generally better to set learning rate around 1.0"
)
if
args
.
train_text_encoder
and
args
.
text_encoder_lr
:
logger
.
warn
(
f
"Learning rates were provided both for the unet and the text encoder- e.g. text_encoder_lr:"
f
"
{
args
.
text_encoder_lr
}
and learning_rate:
{
args
.
learning_rate
}
. "
f
"When using prodigy only learning_rate is used as the initial learning rate."
)
# changes the learning rate of text_encoder_parameters_one and text_encoder_parameters_two to be
# --learning_rate
params_to_optimize
[
1
][
"lr"
]
=
args
.
learning_rate
params_to_optimize
[
2
][
"lr"
]
=
args
.
learning_rate
optimizer
=
optimizer_class
(
optimizer
=
optimizer_class
(
params_to_optimize
,
params_to_optimize
,
lr
=
args
.
learning_rate
,
lr
=
args
.
learning_rate
,
betas
=
(
args
.
adam_beta1
,
args
.
adam_beta2
),
betas
=
(
args
.
adam_beta1
,
args
.
adam_beta2
),
beta3
=
args
.
prodigy_beta3
,
weight_decay
=
args
.
adam_weight_decay
,
weight_decay
=
args
.
adam_weight_decay
,
eps
=
args
.
adam_epsilon
,
eps
=
args
.
adam_epsilon
,
decouple
=
args
.
prodigy_decouple
,
decouple
=
args
.
prodigy_decouple
,
...
...
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