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
db7b7bd9
Unverified
Commit
db7b7bd9
authored
Nov 29, 2022
by
Anton Lozhkov
Committed by
GitHub
Nov 29, 2022
Browse files
[Train unconditional] Unwrap model before EMA (#1469)
parent
6a0a3123
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
examples/unconditional_image_generation/train_unconditional.py
...les/unconditional_image_generation/train_unconditional.py
+6
-1
No files found.
examples/unconditional_image_generation/train_unconditional.py
View file @
db7b7bd9
...
...
@@ -320,7 +320,12 @@ def main(args):
num_update_steps_per_epoch
=
math
.
ceil
(
len
(
train_dataloader
)
/
args
.
gradient_accumulation_steps
)
ema_model
=
EMAModel
(
model
,
inv_gamma
=
args
.
ema_inv_gamma
,
power
=
args
.
ema_power
,
max_value
=
args
.
ema_max_decay
)
ema_model
=
EMAModel
(
accelerator
.
unwrap_model
(
model
),
inv_gamma
=
args
.
ema_inv_gamma
,
power
=
args
.
ema_power
,
max_value
=
args
.
ema_max_decay
,
)
# Handle the repository creation
if
accelerator
.
is_main_process
:
...
...
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