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
f7154f85
Unverified
Commit
f7154f85
authored
Jan 04, 2023
by
Manfred Lindmark
Committed by
GitHub
Jan 04, 2023
Browse files
Fix --resume_from_checkpoint step in train_text_to_image.py (#1914)
fix resume step in train_text_to_image example
parent
675ef1ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
examples/text_to_image/train_text_to_image.py
examples/text_to_image/train_text_to_image.py
+2
-3
No files found.
examples/text_to_image/train_text_to_image.py
View file @
f7154f85
...
@@ -685,9 +685,8 @@ def main():
...
@@ -685,9 +685,8 @@ def main():
accelerator
.
load_state
(
os
.
path
.
join
(
args
.
output_dir
,
path
))
accelerator
.
load_state
(
os
.
path
.
join
(
args
.
output_dir
,
path
))
global_step
=
int
(
path
.
split
(
"-"
)[
1
])
global_step
=
int
(
path
.
split
(
"-"
)[
1
])
resume_global_step
=
global_step
*
args
.
gradient_accumulation_steps
first_epoch
=
global_step
//
num_update_steps_per_epoch
first_epoch
=
resume_global_step
//
num_update_steps_per_epoch
resume_step
=
global_step
%
num_update_steps_per_epoch
resume_step
=
resume_global_step
%
num_update_steps_per_epoch
# Only show the progress bar once on each machine.
# Only show the progress bar once on each machine.
progress_bar
=
tqdm
(
range
(
global_step
,
args
.
max_train_steps
),
disable
=
not
accelerator
.
is_local_main_process
)
progress_bar
=
tqdm
(
range
(
global_step
,
args
.
max_train_steps
),
disable
=
not
accelerator
.
is_local_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