Spaces:
Runtime error
Runtime error
my bad
Browse files
model.py
CHANGED
@@ -11,14 +11,16 @@ def create_model():
|
|
11 |
weights = models.Swin_B_Weights.DEFAULT
|
12 |
transform = weights.transforms()
|
13 |
|
14 |
-
model = models.
|
15 |
|
16 |
for param in model.parameters():
|
17 |
param.requires_grad = False
|
18 |
|
19 |
-
model.
|
20 |
-
nn.
|
21 |
-
nn.
|
|
|
|
|
22 |
)
|
23 |
|
24 |
|
|
|
11 |
weights = models.Swin_B_Weights.DEFAULT
|
12 |
transform = weights.transforms()
|
13 |
|
14 |
+
model = models.swin_b(weights = weights)
|
15 |
|
16 |
for param in model.parameters():
|
17 |
param.requires_grad = False
|
18 |
|
19 |
+
model.head = nn.Sequential(
|
20 |
+
# nn.Linear(in_features = 1024, out_features = 512, bias = True),
|
21 |
+
# nn.ReLU(),
|
22 |
+
# nn.Dropout(p = 0.3, inplace = True),
|
23 |
+
nn.Linear(in_features = 1024, out_features = num_classes, bias = True)
|
24 |
)
|
25 |
|
26 |
|