From f6b74785126c236bfaeec0caf988d3a73d1a7efe Mon Sep 17 00:00:00 2001 From: Sergey Date: Fri, 17 Apr 2020 20:05:19 +0700 Subject: [PATCH] del fc layer --- pretrainedmodels/models/torchvision_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pretrainedmodels/models/torchvision_models.py b/pretrainedmodels/models/torchvision_models.py index f934716..76cd932 100644 --- a/pretrainedmodels/models/torchvision_models.py +++ b/pretrainedmodels/models/torchvision_models.py @@ -314,7 +314,7 @@ def forward(self, input): def modify_resnets(model): # Modify attributs model.last_linear = model.fc - model.fc = None + del model.fc def features(self, input): x = self.conv1(input)