The error is most likely caused by an image with 4 channels (additional alpha channel), while the rest seem to use 3 channels (RGB only).
You could iterate your DataLoader once and make sure it’s able to create the batches.
How would a “fault-tolerant” dataset work? I.e. you could use a try/except block in the Dataset.__getitem__, but I wouldn’t know what you want to return in case the sample is broken.
E.g. returning a random tensor instead or a static tensor would interfere with your training.