This commit is contained in:
Glenn Jocher 2020-03-09 18:49:35 -07:00
parent 821a72b2d3
commit d8370d13ea
1 changed files with 3 additions and 3 deletions

View File

@ -35,15 +35,15 @@ def create_modules(module_defs, img_size, arc):
bias=not bn)) bias=not bn))
if bn: if bn:
modules.add_module('BatchNorm2d', nn.BatchNorm2d(filters, momentum=0.1)) 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 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.LeakyReLU(0.1, inplace=True))
# modules.add_module('activation', nn.PReLU(num_parameters=1, init=0.10)) # modules.add_module('activation', nn.PReLU(num_parameters=1, init=0.10))
elif mdef['activation'] == 'swish': elif mdef['activation'] == 'swish':
modules.add_module('activation', Swish()) modules.add_module('activation', Swish())
if not bn: # detection output layer
routs.append(i)
elif mdef['type'] == 'maxpool': elif mdef['type'] == 'maxpool':
size = mdef['size'] size = mdef['size']
stride = mdef['stride'] stride = mdef['stride']