Hi,
I try to train a model. After the training, I try to get a sample of generated images, but I get an index out of bounds error (see below).
This is what I run in the notebook:
learn.show_results(rows=5, thresh=0.5, nms_overlap=0.1)
IndexError Traceback (most recent call last)
<ipython-input-81-0dd45fac659f> in <module>()
----> 1 learn.show_results(rows=2, thresh=0.5, nms_overlap=0.1)
/usr/local/lib/python3.6/dist-packages/fastai/basic_train.py in show_results(self, ds_type, rows, **kwargs)
403 if has_arg(ds.y.reconstruct, 'x'):
404 ys = [ds.y.reconstruct(grab_idx(y, i), x=x) for i,x in enumerate(xs)]
--> 405 zs = [ds.y.reconstruct(z, x=x) for z,x in zip(preds,xs)]
406 else :
407 ys = [ds.y.reconstruct(grab_idx(y, i)) for i in range(n_items)]
/usr/local/lib/python3.6/dist-packages/fastai/basic_train.py in <listcomp>(.0)
403 if has_arg(ds.y.reconstruct, 'x'):
404 ys = [ds.y.reconstruct(grab_idx(y, i), x=x) for i,x in enumerate(xs)]
--> 405 zs = [ds.y.reconstruct(z, x=x) for z,x in zip(preds,xs)]
406 else :
407 ys = [ds.y.reconstruct(grab_idx(y, i)) for i in range(n_items)]
/usr/local/lib/python3.6/dist-packages/fastai/vision/data.py in reconstruct(self, t, x)
361 i = (labels - self.pad_idx).nonzero().min()
362 bboxes,labels = bboxes[i:],labels[i:]
--> 363 return ImageBBox.create(*x.size, bboxes, labels=labels, classes=self.classes, scale=False)
364
365 class ObjectItemList(ImageList):
/usr/local/lib/python3.6/dist-packages/fastai/vision/image.py in create(cls, h, w, bboxes, labels, classes, pad_idx, scale)
352 if isinstance(bboxes, np.ndarray) and bboxes.dtype == np.object: bboxes = np.array([bb for bb in bboxes])
353 bboxes = tensor(bboxes).float()
--> 354 tr_corners = torch.cat([bboxes[:,0][:,None], bboxes[:,3][:,None]], 1)
355 bl_corners = bboxes[:,1:3].flip(1)
356 bboxes = torch.cat([bboxes[:,:2], tr_corners, bl_corners, bboxes[:,2:]], 1)
IndexError: index 3 is out of bounds for dimension 1 with size 2