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
OpenDAS
apex
Commits
06ee98c2
Commit
06ee98c2
authored
Jun 08, 2018
by
Christian Sarofeen
Browse files
[Imagenet example] Switch validation to same I/O pipeline so validation produces correct result.
parent
421c9e66
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
examples/imagenet/main.py
examples/imagenet/main.py
+2
-7
No files found.
examples/imagenet/main.py
View file @
06ee98c2
...
@@ -190,19 +190,14 @@ def main():
...
@@ -190,19 +190,14 @@ def main():
train_dataset
,
batch_size
=
args
.
batch_size
,
shuffle
=
(
train_sampler
is
None
),
train_dataset
,
batch_size
=
args
.
batch_size
,
shuffle
=
(
train_sampler
is
None
),
num_workers
=
args
.
workers
,
pin_memory
=
True
,
sampler
=
train_sampler
,
collate_fn
=
fast_collate
)
num_workers
=
args
.
workers
,
pin_memory
=
True
,
sampler
=
train_sampler
,
collate_fn
=
fast_collate
)
normalize
=
transforms
.
Normalize
(
mean
=
[
0.485
,
0.456
,
0.406
],
std
=
[
0.229
,
0.224
,
0.225
])
val_loader
=
torch
.
utils
.
data
.
DataLoader
(
val_loader
=
torch
.
utils
.
data
.
DataLoader
(
datasets
.
ImageFolder
(
valdir
,
transforms
.
Compose
([
datasets
.
ImageFolder
(
valdir
,
transforms
.
Compose
([
transforms
.
Resize
(
val_size
),
transforms
.
Resize
(
val_size
),
transforms
.
CenterCrop
(
crop_size
),
transforms
.
CenterCrop
(
crop_size
),
transforms
.
ToTensor
(),
normalize
,
])),
])),
batch_size
=
args
.
batch_size
,
shuffle
=
False
,
batch_size
=
args
.
batch_size
,
shuffle
=
False
,
num_workers
=
args
.
workers
,
pin_memory
=
True
)
num_workers
=
args
.
workers
,
pin_memory
=
True
,
collate_fn
=
fast_collate
)
if
args
.
evaluate
:
if
args
.
evaluate
:
validate
(
val_loader
,
model
,
criterion
)
validate
(
val_loader
,
model
,
criterion
)
...
...
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