That’s good news! Your SMOTE approach sounds interesting.
Your error is most likely due to the image loading.
It seems the channels are in dimension 3, while PyTorch needs them in dimension 1.
Try to permute your images where you are loading them:
image = image.permute(0, 3, 1, 2).contiguous()

Let me know, if it helps!