It looks like you are dealing with e.g. a segmentation task, since you are loading an image and a mask.
Is this correct?
If so, you should make sure both inputs have the same size as your transformations won’t work otherwise.