The image tensor need to have the same number of channels as well as the same spatial size, which is apparently not the case for your samples.
You could use torchvision.transforms.Resize to create the same spatial size.