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
fb98acf0
Unverified
Commit
fb98acf0
authored
Jan 25, 2023
by
Oren WANG
Committed by
GitHub
Jan 25, 2023
Browse files
[lora] Fix bug with training without validation (#2106)
parent
180841bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
examples/dreambooth/train_dreambooth_lora.py
examples/dreambooth/train_dreambooth_lora.py
+13
-13
No files found.
examples/dreambooth/train_dreambooth_lora.py
View file @
fb98acf0
...
...
@@ -984,19 +984,19 @@ def main(args):
prompt
=
args
.
num_validation_images
*
[
args
.
validation_prompt
]
images
=
pipeline
(
prompt
,
num_inference_steps
=
25
,
generator
=
generator
).
images
for
tracker
in
accelerator
.
trackers
:
if
tracker
.
name
==
"tensorboard"
:
np_images
=
np
.
stack
([
np
.
asarray
(
img
)
for
img
in
images
])
tracker
.
writer
.
add_images
(
"test"
,
np_images
,
epoch
,
dataformats
=
"NHWC"
)
if
tracker
.
name
==
"wandb"
:
tracker
.
log
(
{
"test"
:
[
wandb
.
Image
(
image
,
caption
=
f
"
{
i
}
:
{
args
.
validation_prompt
}
"
)
for
i
,
image
in
enumerate
(
images
)
]
}
)
for
tracker
in
accelerator
.
trackers
:
if
tracker
.
name
==
"tensorboard"
:
np_images
=
np
.
stack
([
np
.
asarray
(
img
)
for
img
in
images
])
tracker
.
writer
.
add_images
(
"test"
,
np_images
,
epoch
,
dataformats
=
"NHWC"
)
if
tracker
.
name
==
"wandb"
:
tracker
.
log
(
{
"test"
:
[
wandb
.
Image
(
image
,
caption
=
f
"
{
i
}
:
{
args
.
validation_prompt
}
"
)
for
i
,
image
in
enumerate
(
images
)
]
}
)
if
args
.
push_to_hub
:
save_model_card
(
...
...
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