That’s strange indeed. If I understand you correctly you are adding an assert statement inside the DataLoader loop with a single sample per batch to check for 4 channels in each input.
However, this assert is never raised and instead the conv layer raises an assert claiming that the input has 3 channels, while 4 are expected?
In that case it seems that the channel might have been removed while passing it to the model, so I would check the forward method and see, if the input is sliced there.