Last week it was working fine, not sure why now I have this error? Any idea how to create a pipeline with the following functions get_y=[attrgetter(“name”), RegexLabeller(pat=r’^(.)_\d+…$’)],?
solids = DataBlock(
blocks=(ImageBlock, CategoryBlock),
get_items=get_image_files,
splitter=RandomSplitter(valid_pct=0.3, seed=42),
get_y=[attrgetter("name"), RegexLabeller(pat=r'^(.*)_\d+\..*$')],
item_tfms=Resize(128))
ValueError Traceback (most recent call last)
<ipython-input-79-68317656f5d7> in <module>
4 splitter=RandomSplitter(valid_pct=0.3, seed=42),
5 get_y=[attrgetter("name"), RegexLabeller(pat=r'^(.*)_\d+\..*$')],
----> 6 item_tfms=Resize(128))
/opt/conda/envs/fastai/lib/python3.7/site-packages/fastcore/foundation.py in _init(self, *args, **kwargs)
155 if isinstance(arg,MethodType): arg = MethodType(arg.__func__, self)
156 setattr(self, k, arg)
--> 157 old_init(self, *args, **kwargs)
158 functools.update_wrapper(_init, old_init)
159 cls.__init__ = use_kwargs(cls._methods)(_init)
/opt/conda/envs/fastai/lib/python3.7/site-packages/fastai2/data/block.py in __init__(self, blocks, dl_type, getters, n_inp, item_tfms, batch_tfms, **kwargs)
77 n_targs = len(self.getters) - self.n_inp
78 if len(L(self.get_y)) != n_targs:
---> 79 raise ValueError(f'get_y contains {len(L(self.get_y))} functions, but must contain {n_targs} (one for each target)\n{self._msg}')
80 self.getters[self.n_inp:] = L(self.get_y)
81
**ValueError: get_y contains 2 functions, but must contain 1 (one for each target)**
** If you wanted to compose several transforms in your getter don’t forget to wrap them in a Pipeline
.**