Hi @jeremy -
I’m getting the same error that @wgpubs was getting earlier:
RuntimeError: running_mean should contain 3 elements not 1024
Git is up to date (latest commit: c738837b39829902525e9c17761faf6f1c2ae88c), I have restarted my kernel, restarted jupyter notebook, etc. I am running the AMI on EC2.
I am running the lesson 1 notebook exactly as is, and have added 1 cell after we train the initial model in which I am trying to predict one of the images:
Any help would be appreciated!
Full traceback:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-13-41c993a2ac6d> in <module>()
3 ds = FilesIndexArrayDataset([fn], np.array([0]), val_tfms, PATH)
4 dl = DataLoader(ds)
----> 5 preds = learn.predict_dl(dl)
~/fastai/courses/dl1/fastai/learner.py in predict_dl(self, dl)
110 return predict_with_targs(self.model, dl)
111
--> 112 def predict_dl(self, dl): return predict_with_targs(self.model, dl)[0]
113 def predict_array(self, arr): return to_np(self.model(V(T(arr).cuda())))
114
~/fastai/courses/dl1/fastai/model.py in predict_with_targs(m, dl)
115 if hasattr(m, 'reset'): m.reset()
116 preda,targa = zip(*[(get_prediction(m(*VV(x))),y)
--> 117 for *x,y in iter(dl)])
118 return to_np(torch.cat(preda)), to_np(torch.cat(targa))
119
~/fastai/courses/dl1/fastai/model.py in <listcomp>(.0)
115 if hasattr(m, 'reset'): m.reset()
116 preda,targa = zip(*[(get_prediction(m(*VV(x))),y)
--> 117 for *x,y in iter(dl)])
118 return to_np(torch.cat(preda)), to_np(torch.cat(targa))
119
~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
222 for hook in self._forward_pre_hooks.values():
223 hook(self, input)
--> 224 result = self.forward(*input, **kwargs)
225 for hook in self._forward_hooks.values():
226 hook_result = hook(self, input, result)
~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/container.py in forward(self, input)
65 def forward(self, input):
66 for module in self._modules.values():
---> 67 input = module(input)
68 return input
69
~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
222 for hook in self._forward_pre_hooks.values():
223 hook(self, input)
--> 224 result = self.forward(*input, **kwargs)
225 for hook in self._forward_hooks.values():
226 hook_result = hook(self, input, result)
~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py in forward(self, input)
35 return F.batch_norm(
36 input, self.running_mean, self.running_var, self.weight, self.bias,
---> 37 self.training, self.momentum, self.eps)
38
39 def __repr__(self):
~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/functional.py in batch_norm(input, running_mean, running_var, weight, bias, training, momentum, eps)
637 training=False, momentum=0.1, eps=1e-5):
638 f = torch._C._functions.BatchNorm(running_mean, running_var, training, momentum, eps, torch.backends.cudnn.enabled)
--> 639 return f(input, weight, bias)
640
641
RuntimeError: running_mean should contain 3 elements not 1024