Skip to content
Snippets Groups Projects
Commit 91c2a429 authored by Tim Laibacher's avatar Tim Laibacher
Browse files

Remove unused parts of MobileNetV2

parent 49401e67
No related branches found
No related tags found
1 merge request!1Ssl
Pipeline #30727 failed
...@@ -80,14 +80,14 @@ class MobileNetV2(nn.Module): ...@@ -80,14 +80,14 @@ class MobileNetV2(nn.Module):
[6, 32, 3, 2], [6, 32, 3, 2],
[6, 64, 4, 2], [6, 64, 4, 2],
[6, 96, 3, 1], [6, 96, 3, 1],
[6, 160, 3, 2], #[6, 160, 3, 2],
[6, 320, 1, 1], #[6, 320, 1, 1],
] ]
# building first layer # building first layer
assert input_size % 32 == 0 assert input_size % 32 == 0
input_channel = int(input_channel * width_mult) input_channel = int(input_channel * width_mult)
self.last_channel = int(last_channel * width_mult) if width_mult > 1.0 else last_channel #self.last_channel = int(last_channel * width_mult) if width_mult > 1.0 else last_channel
self.features = [conv_bn(3, input_channel, 2)] self.features = [conv_bn(3, input_channel, 2)]
# building inverted residual blocks # building inverted residual blocks
for t, c, n, s in interverted_residual_setting: for t, c, n, s in interverted_residual_setting:
...@@ -99,15 +99,15 @@ class MobileNetV2(nn.Module): ...@@ -99,15 +99,15 @@ class MobileNetV2(nn.Module):
self.features.append(block(input_channel, output_channel, 1, expand_ratio=t)) self.features.append(block(input_channel, output_channel, 1, expand_ratio=t))
input_channel = output_channel input_channel = output_channel
# building last several layers # building last several layers
self.features.append(conv_1x1_bn(input_channel, self.last_channel)) #self.features.append(conv_1x1_bn(input_channel, self.last_channel))
# make it nn.Sequential # make it nn.Sequential
self.features = nn.Sequential(*self.features) self.features = nn.Sequential(*self.features)
# building classifier # building classifier
self.classifier = nn.Sequential( #self.classifier = nn.Sequential(
nn.Dropout(0.2), # nn.Dropout(0.2),
nn.Linear(self.last_channel, n_class), # nn.Linear(self.last_channel, n_class),
) #)
self._initialize_weights() self._initialize_weights()
......
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