Your model works with an input size of [batch_size, 3, 224, 224].
Could you post the Dataset or generally how you load and process the data?
Based on the error message it seems there is a mismatch between your data and target.
PS: I’ve formatted your post. You can add code snippets using three backticks.