diff --git a/models.py b/models.py index 568b1267..f7632267 100755 --- a/models.py +++ b/models.py @@ -35,15 +35,15 @@ def create_modules(module_defs, img_size, arc): bias=not bn)) if bn: modules.add_module('BatchNorm2d', nn.BatchNorm2d(filters, momentum=0.1)) + else: + routs.append(i) # detection output (goes into yolo layer) + if mdef['activation'] == 'leaky': # activation study https://github.com/ultralytics/yolov3/issues/441 modules.add_module('activation', nn.LeakyReLU(0.1, inplace=True)) # modules.add_module('activation', nn.PReLU(num_parameters=1, init=0.10)) elif mdef['activation'] == 'swish': modules.add_module('activation', Swish()) - if not bn: # detection output layer - routs.append(i) - elif mdef['type'] == 'maxpool': size = mdef['size'] stride = mdef['stride']