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
a6314a8d
Unverified
Commit
a6314a8d
authored
Oct 27, 2022
by
Anton Lozhkov
Committed by
GitHub
Oct 27, 2022
Browse files
Add `--dataloader_num_workers` to the DDPM training example (#1027)
parent
939ec17e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
examples/unconditional_image_generation/train_unconditional.py
...les/unconditional_image_generation/train_unconditional.py
+13
-2
No files found.
examples/unconditional_image_generation/train_unconditional.py
View file @
a6314a8d
...
@@ -83,7 +83,16 @@ def parse_args():
...
@@ -83,7 +83,16 @@ def parse_args():
"--train_batch_size"
,
type
=
int
,
default
=
16
,
help
=
"Batch size (per device) for the training dataloader."
"--train_batch_size"
,
type
=
int
,
default
=
16
,
help
=
"Batch size (per device) for the training dataloader."
)
)
parser
.
add_argument
(
parser
.
add_argument
(
"--eval_batch_size"
,
type
=
int
,
default
=
16
,
help
=
"Batch size (per device) for the eval dataloader."
"--eval_batch_size"
,
type
=
int
,
default
=
16
,
help
=
"The number of images to generate for evaluation."
)
parser
.
add_argument
(
"--dataloader_num_workers"
,
type
=
int
,
default
=
0
,
help
=
(
"The number of subprocesses to use for data loading. 0 means that the data will be loaded in the main"
" process."
),
)
)
parser
.
add_argument
(
"--num_epochs"
,
type
=
int
,
default
=
100
)
parser
.
add_argument
(
"--num_epochs"
,
type
=
int
,
default
=
100
)
parser
.
add_argument
(
"--save_images_epochs"
,
type
=
int
,
default
=
10
,
help
=
"How often to save images during training."
)
parser
.
add_argument
(
"--save_images_epochs"
,
type
=
int
,
default
=
10
,
help
=
"How often to save images during training."
)
...
@@ -249,7 +258,9 @@ def main(args):
...
@@ -249,7 +258,9 @@ def main(args):
return
{
"input"
:
images
}
return
{
"input"
:
images
}
dataset
.
set_transform
(
transforms
)
dataset
.
set_transform
(
transforms
)
train_dataloader
=
torch
.
utils
.
data
.
DataLoader
(
dataset
,
batch_size
=
args
.
train_batch_size
,
shuffle
=
True
)
train_dataloader
=
torch
.
utils
.
data
.
DataLoader
(
dataset
,
batch_size
=
args
.
train_batch_size
,
shuffle
=
True
,
num_workers
=
args
.
dataloader_num_workers
)
lr_scheduler
=
get_scheduler
(
lr_scheduler
=
get_scheduler
(
args
.
lr_scheduler
,
args
.
lr_scheduler
,
...
...
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