From 61e3958973e38ab7e14ab2f4e832218c682f23c7 Mon Sep 17 00:00:00 2001 From: Schneider Leo <leo.schneider@etu.ec-lyon.fr> Date: Mon, 16 Jun 2025 14:06:15 +0200 Subject: [PATCH] fix : resnet50 linear layer shape --- models/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/model.py b/models/model.py index b601c64..3fde4b1 100644 --- a/models/model.py +++ b/models/model.py @@ -324,7 +324,7 @@ class Classification_model_duo_pretrained(nn.Module): if model =='ResNet50': self.im_encoder = torch.hub.load('pretrained_model/pytorch_vision_v0.10.0/', 'resnet50', pretrained=True,source='local') - self.im_encoder.fc = torch.nn.Linear(2000, self.n_class) + self.im_encoder.fc = torch.nn.Linear(2048, self.n_class) #freeze backbone for n, p in self.im_encoder.named_parameters(): if n not in ['fc.weight', 'fc.bias']: -- GitLab