Hi @LambertWM @muellerzr ,
I am also trying to do an object detection with external data.
When I try to create dataloaders
with below command:
dls = siim.dataloaders(path/'train')
It fails and throws below error, kindly help if possible.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-12-228fd72431ff> in <module>
----> 1 dls = siim.dataloaders(path/'train')
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastai/data/block.py in dataloaders(self, source, path, verbose, **kwargs)
111
112 def dataloaders(self, source, path='.', verbose=False, **kwargs):
--> 113 dsets = self.datasets(source, verbose=verbose)
114 kwargs = {**self.dls_kwargs, **kwargs, 'verbose': verbose}
115 return dsets.dataloaders(path=path, after_item=self.item_tfms, after_batch=self.batch_tfms, **kwargs)
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastai/data/block.py in datasets(self, source, verbose)
108 splits = (self.splitter or RandomSplitter())(items)
109 pv(f"{len(splits)} datasets of sizes {','.join([str(len(s)) for s in splits])}", verbose)
--> 110 return Datasets(items, tfms=self._combine_type_tfms(), splits=splits, dl_type=self.dl_type, n_inp=self.n_inp, verbose=verbose)
111
112 def dataloaders(self, source, path='.', verbose=False, **kwargs):
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastai/data/core.py in __init__(self, items, tfms, tls, n_inp, dl_type, **kwargs)
308 def __init__(self, items=None, tfms=None, tls=None, n_inp=None, dl_type=None, **kwargs):
309 super().__init__(dl_type=dl_type)
--> 310 self.tls = L(tls if tls else [TfmdLists(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
311 self.n_inp = ifnone(n_inp, max(1, len(self.tls)-1))
312
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastai/data/core.py in <listcomp>(.0)
308 def __init__(self, items=None, tfms=None, tls=None, n_inp=None, dl_type=None, **kwargs):
309 super().__init__(dl_type=dl_type)
--> 310 self.tls = L(tls if tls else [TfmdLists(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
311 self.n_inp = ifnone(n_inp, max(1, len(self.tls)-1))
312
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastcore/foundation.py in __call__(cls, x, *args, **kwargs)
95 def __call__(cls, x=None, *args, **kwargs):
96 if not args and not kwargs and x is not None and isinstance(x,cls): return x
---> 97 return super().__call__(x, *args, **kwargs)
98
99 # Cell
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastai/data/core.py in __init__(self, items, tfms, use_list, do_setup, split_idx, train_setup, splits, types, verbose, dl_type)
234 if do_setup:
235 pv(f"Setting up {self.tfms}", verbose)
--> 236 self.setup(train_setup=train_setup)
237
238 def _new(self, items, split_idx=None, **kwargs):
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastai/data/core.py in setup(self, train_setup)
256 for f in self.tfms.fs:
257 self.types.append(getattr(f, 'input_types', type(x)))
--> 258 x = f(x)
259 self.types.append(type(x))
260 types = L(t if is_listy(t) else [t] for t in self.types).concat().unique()
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastcore/transform.py in __call__(self, x, **kwargs)
71 @property
72 def name(self): return getattr(self, '_name', _get_name(self))
---> 73 def __call__(self, x, **kwargs): return self._call('encodes', x, **kwargs)
74 def decode (self, x, **kwargs): return self._call('decodes', x, **kwargs)
75 def __repr__(self): return f'{self.name}:\nencodes: {self.encodes}decodes: {self.decodes}'
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastcore/transform.py in _call(self, fn, x, split_idx, **kwargs)
81 def _call(self, fn, x, split_idx=None, **kwargs):
82 if split_idx!=self.split_idx and self.split_idx is not None: return x
---> 83 return self._do_call(getattr(self, fn), x, **kwargs)
84
85 def _do_call(self, f, x, **kwargs):
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastcore/transform.py in _do_call(self, f, x, **kwargs)
87 if f is None: return x
88 ret = f.returns(x) if hasattr(f,'returns') else None
---> 89 return retain_type(f(x, **kwargs), x, ret)
90 res = tuple(self._do_call(f, x_, **kwargs) for x_ in x)
91 return retain_type(res, x)
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastcore/dispatch.py in __call__(self, *args, **kwargs)
116 elif self.inst is not None: f = MethodType(f, self.inst)
117 elif self.owner is not None: f = MethodType(f, self.owner)
--> 118 return f(*args, **kwargs)
119
120 def __get__(self, inst, owner):
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastai/vision/core.py in create(cls, x, img_size)
197 "Basic type for a tensor of bounding boxes in an image"
198 @classmethod
--> 199 def create(cls, x, img_size=None)->None: return cls(tensor(x).view(-1, 4).float(), img_size=img_size)
200
201 def show(self, ctx=None, **kwargs):
~/miniconda3/envs/fast/lib/python3.8/site-packages/fastai/torch_core.py in tensor(x, *rest, **kwargs)
125 # if isinstance(x, (tuple,list)) and len(x)==0: return tensor(0)
126 res = (x if isinstance(x, Tensor)
--> 127 else torch.tensor(x, **kwargs) if isinstance(x, (tuple,list))
128 else _array2tensor(x) if isinstance(x, ndarray)
129 else as_tensor(x.values, **kwargs) if isinstance(x, (pd.Series, pd.DataFrame))
ValueError: too many dimensions 'str'