Thank you @ptrblck after changing the input size to 299299 instead of 224224 and including aux_logits = False as parameter to the model (an alternative to returning the first value as in self.model(x)[0]) the network runs good now