Skip to content
Permalink
Browse files

Enable batch_norm could raise mAP from 0.6 to 0.7

  • Loading branch information...
RobinDong committed May 28, 2019
1 parent d9ccc69 commit f10bae219c78f1e9f3026d9fe55c625e61a80825
Showing with 5 additions and 5 deletions.
  1. +1 −1 data/config.py
  2. +4 −4 ssd.py
@@ -14,7 +14,7 @@
voc = {
'num_classes': 21,
'lr_steps': (80000, 100000, 120000),
'max_iter': 120000,
'max_iter': 120001,
'feature_maps': [38, 19, 10, 5, 3, 1],
'min_dim': 300,
'steps': [8, 16, 32, 64, 100, 300],
8 ssd.py
@@ -71,14 +71,14 @@ def forward(self, x):
conf = list()

# apply vgg up to conv4_3 relu
for k in range(23):
for k in range(33):
x = self.vgg[k](x)

s = self.L2Norm(x)
sources.append(s)

# apply vgg up to fc7
for k in range(23, len(self.vgg)):
for k in range(33, len(self.vgg)):
x = self.vgg[k](x)
sources.append(x)

@@ -123,7 +123,7 @@ def load_weights(self, base_file):

# This function is derived from torchvision VGG make_layers()
# https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py
def vgg(cfg, i, batch_norm=False):
def vgg(cfg, i, batch_norm=True):
layers = []
in_channels = i
for v in cfg:
@@ -166,7 +166,7 @@ def add_extras(cfg, i, batch_norm=False):
def multibox(vgg, extra_layers, cfg, num_classes):
loc_layers = []
conf_layers = []
vgg_source = [21, -2]
vgg_source = [30, -2]
for k, v in enumerate(vgg_source):
loc_layers += [nn.Conv2d(vgg[v].out_channels,
cfg[k] * 4, kernel_size=3, padding=1)]

0 comments on commit f10bae2

Please sign in to comment.
You can’t perform that action at this time.