提交 06ee98c2 编辑于 作者: Christian Sarofeen's avatar Christian Sarofeen
浏览文件

[Imagenet example] Switch validation to same I/O pipeline so validation produces correct result.

上级 421c9e66
......@@ -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.
先完成此消息的编辑!
想要评论请 注册