Your input contains 4 channels, while the first conv layer expects an input with 3 channels.
If you are dealing with RGB images, the 4th channel might be the alpha channel, which could just be removed.
If you are using a custom DataLoader
, you could probably just use:
def __getitem__(self, index):
img = Image.open(self.paths[index]).convert('RGB')
...
# Alternatively remove the alpha channel from the tensor
img = Image.open(self.paths[index])
x = TF.to_tensor(img)
x = x[:3]
...