I am trying to run the learn.fine_tune in colab but it is showing tensor size mismatch

RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File “/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py”, line 302, in _worker_loop
data = fetcher.fetch(index)
File “/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py”, line 39, in fetch
data = next(self.dataset_iter)
File “/usr/local/lib/python3.7/dist-packages/fastai/data/load.py”, line 140, in create_batches
yield from map(self.do_batch, self.chunkify(res))
File “/usr/local/lib/python3.7/dist-packages/fastai/data/load.py”, line 170, in do_batch
def do_batch(self, b): return self.retain(self.create_batch(self.before_batch(b)), b)
File “/usr/local/lib/python3.7/dist-packages/fastai/data/load.py”, line 168, in create_batch
if not self.prebatched: collate_error(e,b)
File “/usr/local/lib/python3.7/dist-packages/fastai/data/load.py”, line 166, in create_batch
try: return (fa_collate,fa_convert)self.prebatched
File “/usr/local/lib/python3.7/dist-packages/fastai/data/load.py”, line 52, in fa_collate
else type(t[0])([fa_collate(s) for s in zip(*t)]) if isinstance(b, Sequence)
File “/usr/local/lib/python3.7/dist-packages/fastai/data/load.py”, line 52, in
else type(t[0])([fa_collate(s) for s in zip(*t)]) if isinstance(b, Sequence)
File “/usr/local/lib/python3.7/dist-packages/fastai/data/load.py”, line 51, in fa_collate
return (default_collate(t) if isinstance(b, _collate_types)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/utils/collate.py", line 140, in default_collate
out = elem.new(storage).resize
(len(batch), *list(elem.size()))
File “/usr/local/lib/python3.7/dist-packages/fastai/torch_core.py”, line 376, in torch_function
res = super().torch_function(func, types, args, ifnone(kwargs, {}))
File “/usr/local/lib/python3.7/dist-packages/torch/_tensor.py”, line 1121, in torch_function
ret = func(*args, **kwargs)
RuntimeError: Error when trying to collate the data into batches with fa_collate, at least two tensors in the batch are not the same size.

Mismatch found on axis 0 of the batch and is of type TensorImage:
Item at index 0 has shape: torch.Size([3, 4000, 6000])
Item at index 2 has shape: torch.Size([3, 256, 256])

Please include a transform in after_item that ensures all data of type TensorImage is the same size

Based on the error message it seems you are trying to yield image tensors using different spatial sizes, so you might want to add a Resize transformation to create images in the same size.