I am working on Kaggle Ship Detection Competition (image segmentation problem).
Taking reference from 24_tutorial.siamese.ipynb, I am trying to write a mid-level data API for the dataset but I can’t get dls.show_batch
properly working.
The following are the errors I got. To view the full code, you can view it on my notebook (session 4. TfmdLists to DataLoaders):
dls.show_batch();
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-155-988852a6dc95> in <module>
----> 1 dls.show_batch();
~/fastai/fastai2_walkthrough/fastai2/fastai2/data/core.py in show_batch(self, b, max_n, ctxs, show, unique, **kwargs)
97 if b is None: b = self.one_batch()
98 if not show: return self._pre_show_batch(b, max_n=max_n)
---> 99 show_batch(*self._pre_show_batch(b, max_n=max_n), ctxs=ctxs, max_n=max_n, **kwargs)
100 if unique: self.get_idxs = old_get_idxs
101
~/fastai/fastai2_walkthrough/fastcore/fastcore/dispatch.py in __call__(self, *args, **kwargs)
96 if not f: return args[0]
97 if self.inst is not None: f = MethodType(f, self.inst)
---> 98 return f(*args, **kwargs)
99
100 def __get__(self, inst, owner):
~/fastai/fastai2_walkthrough/fastai2/fastai2/data/core.py in show_batch(x, y, samples, ctxs, max_n, **kwargs)
12 def show_batch(x, y, samples, ctxs=None, max_n=9, **kwargs):
13 if ctxs is None: ctxs = Inf.nones
---> 14 if hasattr(samples[0], 'show'):
15 ctxs = [s.show(ctx=c, **kwargs) for s,c,_ in zip(samples,ctxs,range(max_n))]
16 else:
TypeError: 'NoneType' object is not subscriptable
Do any fellows have any idea how to make it work?