Spaces:
Sleeping
Sleeping
KajetanFrackowiak
commited on
Commit
•
2874419
1
Parent(s):
a20a8a0
Upload model.py
Browse files
model.py
CHANGED
@@ -6,7 +6,7 @@ from torch import nn
|
|
6 |
def create_effnetb2_model(num_classes:int=3,
|
7 |
seed:int=42):
|
8 |
weights = torchvision.models.EfficientNet_B2_Weights.DEFAULT
|
9 |
-
|
10 |
model = torchvision.models.efficientnet_b2(weights=weights)
|
11 |
|
12 |
for param in model.parameters():
|
@@ -18,4 +18,4 @@ def create_effnetb2_model(num_classes:int=3,
|
|
18 |
nn.Linear(in_features=1408, out_features=num_classes)
|
19 |
)
|
20 |
|
21 |
-
return model,
|
|
|
6 |
def create_effnetb2_model(num_classes:int=3,
|
7 |
seed:int=42):
|
8 |
weights = torchvision.models.EfficientNet_B2_Weights.DEFAULT
|
9 |
+
transforms = weights.transforms()
|
10 |
model = torchvision.models.efficientnet_b2(weights=weights)
|
11 |
|
12 |
for param in model.parameters():
|
|
|
18 |
nn.Linear(in_features=1408, out_features=num_classes)
|
19 |
)
|
20 |
|
21 |
+
return model, transforms
|