Error: get_y contains ... and wrap them in a Pipeline

Hi I got the following error,

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`.

running:

pets_multi = DataBlock(blocks=(ImageBlock, MultiCategoryBlock),
                 get_items=get_image_files,
                 splitter=RandomSplitter(),
                 get_y=[RegexLabeller(pat = r'/([^/]+)_\d+.jpg$'), multi_l],
                 item_tfms=RandomResizedCrop(460, min_scale=0.75),
                 batch_tfms=[*aug_transforms(size=224, max_warp=0), Normalize.from_stats(*imagenet_stats)])

Any tips about how to “wrap them in a Pipeline.” Thnaks.

Just put your get_y in a Pipeline.

I need to update that notebook but it looks like so:

Pipeline([RegexLabeller, multi_l])

1 Like