Skip to content
GitLab
菜单
项目
群组
代码片段
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
wanggh
apex
提交
06ee98c2
提交
06ee98c2
编辑于
6月 08, 2018
作者:
Christian Sarofeen
浏览文件
[Imagenet example] Switch validation to same I/O pipeline so validation produces correct result.
上级
421c9e66
变更
1
Hide whitespace changes
Inline
Side-by-side
examples/imagenet/main.py
浏览文件 @
06ee98c2
...
...
@@ -190,19 +190,14 @@ def main():
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
)
normalize
=
transforms
.
Normalize
(
mean
=
[
0.485
,
0.456
,
0.406
],
std
=
[
0.229
,
0.224
,
0.225
])
val_loader
=
torch
.
utils
.
data
.
DataLoader
(
datasets
.
ImageFolder
(
valdir
,
transforms
.
Compose
([
transforms
.
Resize
(
val_size
),
transforms
.
CenterCrop
(
crop_size
),
transforms
.
ToTensor
(),
normalize
,
])),
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
:
validate
(
val_loader
,
model
,
criterion
)
...
...
编辑
预览
Supports
Markdown
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录