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
2e69cf16
Unverified
Commit
2e69cf16
authored
Aug 07, 2023
by
Vladislav Artemyev
Committed by
GitHub
Aug 07, 2023
Browse files
Log global_step instead of epoch to tensorboard (#4493)
Co-authored-by:
mrlzla
<
noname@noname.com
>
parent
9c29bc2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
examples/dreambooth/train_dreambooth.py
examples/dreambooth/train_dreambooth.py
+12
-3
No files found.
examples/dreambooth/train_dreambooth.py
View file @
2e69cf16
...
...
@@ -107,7 +107,16 @@ DreamBooth for the text encoder was enabled: {train_text_encoder}.
def
log_validation
(
text_encoder
,
tokenizer
,
unet
,
vae
,
args
,
accelerator
,
weight_dtype
,
epoch
,
prompt_embeds
,
negative_prompt_embeds
text_encoder
,
tokenizer
,
unet
,
vae
,
args
,
accelerator
,
weight_dtype
,
global_step
,
prompt_embeds
,
negative_prompt_embeds
,
):
logger
.
info
(
f
"Running validation...
\n
Generating
{
args
.
num_validation_images
}
images with prompt:"
...
...
@@ -173,7 +182,7 @@ def log_validation(
for
tracker
in
accelerator
.
trackers
:
if
tracker
.
name
==
"tensorboard"
:
np_images
=
np
.
stack
([
np
.
asarray
(
img
)
for
img
in
images
])
tracker
.
writer
.
add_images
(
"validation"
,
np_images
,
epoch
,
dataformats
=
"NHWC"
)
tracker
.
writer
.
add_images
(
"validation"
,
np_images
,
global_step
,
dataformats
=
"NHWC"
)
if
tracker
.
name
==
"wandb"
:
tracker
.
log
(
{
...
...
@@ -1308,7 +1317,7 @@ def main(args):
args
,
accelerator
,
weight_dtype
,
epoch
,
global_step
,
validation_prompt_encoder_hidden_states
,
validation_prompt_negative_prompt_embeds
,
)
...
...
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