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
1037287e
Unverified
Commit
1037287e
authored
Sep 12, 2023
by
Patrick von Platen
Committed by
GitHub
Sep 12, 2023
Browse files
examples fix t2i training (#5001)
* examples fix t2i training * make style
parent
6ea95b7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
examples/t2i_adapter/train_t2i_adapter_sdxl.py
examples/t2i_adapter/train_t2i_adapter_sdxl.py
+3
-1
No files found.
examples/t2i_adapter/train_t2i_adapter_sdxl.py
View file @
1037287e
...
@@ -1060,7 +1060,9 @@ def main(args):
...
@@ -1060,7 +1060,9 @@ def main(args):
)
)
# Prepare everything with our `accelerator`.
# Prepare everything with our `accelerator`.
t2iadapter
,
optimizer
,
lr_scheduler
=
accelerator
.
prepare
(
t2iadapter
,
optimizer
,
lr_scheduler
)
t2iadapter
,
optimizer
,
train_dataloader
,
lr_scheduler
=
accelerator
.
prepare
(
t2iadapter
,
optimizer
,
train_dataloader
,
lr_scheduler
)
# We need to recalculate our total training steps as the size of the training dataloader may have changed.
# We need to recalculate our total training steps as the size of the training dataloader may have changed.
num_update_steps_per_epoch
=
math
.
ceil
(
len
(
train_dataloader
)
/
args
.
gradient_accumulation_steps
)
num_update_steps_per_epoch
=
math
.
ceil
(
len
(
train_dataloader
)
/
args
.
gradient_accumulation_steps
)
...
...
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