Skip to content
Snippets Groups Projects
Commit 262e52a7 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[models.densenet] Use internal model constant

parent eacfa301
No related branches found
No related tags found
1 merge request!6Making use of LightningDataModule and simplification of data loading
......@@ -105,7 +105,9 @@ class Densenet(pl.LightningModule):
self.model_ft = models.densenet121(weights=weights)
# Adapt output features
self.model_ft.classifier = torch.nn.Linear(1024, num_classes)
self.model_ft.classifier = torch.nn.Linear(
self.model_ft.classifier.in_features, num_classes
)
def forward(self, x):
x = self.normalizer(x) # type: ignore
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment