Unverified Commit 1d2094a1 authored by Christian Sarofeen's avatar Christian Sarofeen Committed by GitHub
Browse files

Merge pull request #21 from romerojosh/master

Fix to imagenet main.py data normalization.
parents 80479eed 21c229e0
...@@ -238,8 +238,8 @@ class data_prefetcher(): ...@@ -238,8 +238,8 @@ class data_prefetcher():
def __init__(self, loader): def __init__(self, loader):
self.loader = iter(loader) self.loader = iter(loader)
self.stream = torch.cuda.Stream() self.stream = torch.cuda.Stream()
self.mean = torch.tensor([0.485, 0.456, 0.406]).cuda().view(1,3,1,1) self.mean = torch.tensor([0.485 * 255, 0.456 * 255, 0.406 * 255]).cuda().view(1,3,1,1)
self.std = torch.tensor([0.229, 0.224, 0.225]).cuda().view(1,3,1,1) self.std = torch.tensor([0.229 * 255, 0.224 * 255, 0.225 * 255]).cuda().view(1,3,1,1)
if args.fp16: if args.fp16:
self.mean = self.mean.half() self.mean = self.mean.half()
self.std = self.std.half() self.std = self.std.half()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment