Batch resize, how to do it

I’m trying to do a resizeing of the whole batch but can’t make it work.
I’s supposed to first do item-resize to 40, 96 in this example and then do some transforms and finish with a batch resize to 30,30 just to see that it works.

It works just fine when using the predefined augmentation:

batch_tfms = aug_transforms(size=30, max_rotate=30., min_scale=0.75, flip_vert=True, do_flip=True)
dls = ImageDataLoaders.from_lists(path = ‘.’, fnames=files,labels=labels, bs=9, valid_pct=0.0,
batch_tfms=batch_tfms,
item_tfms=Resize((40,96)))
b = dls.one_batch()
b[0].shape

returns torch.Size([9, 3, 30, 30])

That is correct.
I do not understand why this snipped does not give the same answer

batch_tfms = [Resize(30)]
dls = ImageDataLoaders.from_lists(path = ‘.’, fnames=files,labels=labels, bs=9, valid_pct=0.0,
batch_tfms=batch_tfms,
item_tfms=Resize((40,96)))
b = dls.one_batch()
b[0].shape

returns torch.Size([9, 3, 40, 96])

What have I missed?

It looks very similar to this thread but I didn’t find a solution: