it is likely because the images in your train_dataset are of different sizes, and loader is trying to concatenate them before returning them to you (by default that’s what loader will do).
You can do two things:

add a transform to dataset that crops the outputs to a fixed value
give your own collate_fn function to loader that concatenates the dataset outputs of a mini-batch in a different way than the default one 61