shape of train:
dls.train.one_batch()[0].shape,dls.train.one_batch()[1].shape (torch.Size([256, 784]), torch.Size([256, 10]))
stack trace is as follows
IndexError Traceback (most recent call last)
in ()
1
----> 2 learn.fit(20, lr = 0.1)
15 frames
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in fit(self, n_epoch, lr, wd, cbs, reset_opt)
219 self.opt.set_hypers(lr=self.lr if lr is None else lr)
220 self.n_epoch = n_epoch
â 221 self._with_events(self._do_fit, âfitâ, CancelFitException, self._end_cleanup)
222
223 def _end_cleanup(self): self.dl,self.xb,self.yb,self.pred,self.loss = None,(None,),(None,),None,None
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in with_events(self, f, event_type, ex, final)
161
162 def with_events(self, f, event_type, ex, final=noop):
â 163 try: self(fâbefore{event_type}â); f()
164 except ex: self(fâafter_cancel{event_type}â)
165 self(fâafter_{event_type}â); final()
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in _do_fit(self)
210 for epoch in range(self.n_epoch):
211 self.epoch=epoch
â 212 self._with_events(self._do_epoch, âepochâ, CancelEpochException)
213
214 def fit(self, n_epoch, lr=None, wd=None, cbs=None, reset_opt=False):
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in with_events(self, f, event_type, ex, final)
161
162 def with_events(self, f, event_type, ex, final=noop):
â 163 try: self(fâbefore{event_type}â); f()
164 except ex: self(fâafter_cancel{event_type}â)
165 self(fâafter_{event_type}â); final()
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in _do_epoch(self)
204
205 def _do_epoch(self):
â 206 self._do_epoch_train()
207 self._do_epoch_validate()
208
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in _do_epoch_train(self)
196 def _do_epoch_train(self):
197 self.dl = self.dls.train
â 198 self._with_events(self.all_batches, âtrainâ, CancelTrainException)
199
200 def _do_epoch_validate(self, ds_idx=1, dl=None):
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in with_events(self, f, event_type, ex, final)
161
162 def with_events(self, f, event_type, ex, final=noop):
â 163 try: self(fâbefore{event_type}â); f()
164 except ex: self(fâafter_cancel{event_type}â)
165 self(fâafter_{event_type}â); final()
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in all_batches(self)
167 def all_batches(self):
168 self.n_iter = len(self.dl)
â 169 for o in enumerate(self.dl): self.one_batch(*o)
170
171 def _do_one_batch(self):
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in one_batch(self, i, b)
192 b = self._set_device(b)
193 self._split(b)
â 194 self._with_events(self._do_one_batch, âbatchâ, CancelBatchException)
195
196 def _do_epoch_train(self):
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in with_events(self, f, event_type, ex, final)
161
162 def with_events(self, f, event_type, ex, final=noop):
â 163 try: self(fâbefore{event_type}â); f()
164 except ex: self(fâafter_cancel{event_type}â)
165 self(fâafter_{event_type}â); final()
/usr/local/lib/python3.7/dist-packages/fastai/learner.py in _do_one_batch(self)
170
171 def _do_one_batch(self):
â 172 self.pred = self.model(*self.xb)
173 self(âafter_predâ)
174 if len(self.yb):
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
1049 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1050 or _global_forward_hooks or _global_forward_pre_hooks):
â 1051 return forward_call(*input, **kwargs)
1052 # Do not call functions when jit is used
1053 full_backward_hooks, non_full_backward_hooks = [], []
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/container.py in forward(self, input)
137 def forward(self, input):
138 for module in self:
â 139 input = module(input)
140 return input
141
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
1049 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1050 or _global_forward_hooks or _global_forward_pre_hooks):
â 1051 return forward_call(*input, **kwargs)
1052 # Do not call functions when jit is used
1053 full_backward_hooks, non_full_backward_hooks = [], []
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/activation.py in forward(self, input)
1325
1326 def forward(self, input: Tensor) â Tensor:
â 1327 return F.log_softmax(input, self.dim, _stacklevel=5)
1328
1329 def extra_repr(self):
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py in log_softmax(input, dim, _stacklevel, dtype)
1766 dim = _get_softmax_dim(âlog_softmaxâ, input.dim(), _stacklevel)
1767 if dtype is None:
â 1768 ret = input.log_softmax(dim)
1769 else:
1770 ret = input.log_softmax(dim, dtype=dtype)
IndexError: Dimension out of range (expected to be in range of [-2, 1], but got 10)