diff --git a/models.py b/models.py index c7bb0b80..171ed5f5 100755 --- a/models.py +++ b/models.py @@ -20,7 +20,7 @@ def create_modules(module_defs): modules = nn.Sequential() if module_def['type'] == 'convolutional': - bn = int(module_def['batch_normalize']) + bn = int(module_def['batch_normalize']) if 'batch_normalize' in module_def else 0 filters = int(module_def['filters']) kernel_size = int(module_def['size']) pad = (kernel_size - 1) // 2 if int(module_def['pad']) else 0 diff --git a/utils/parse_config.py b/utils/parse_config.py index e72d5a79..a8ce537c 100644 --- a/utils/parse_config.py +++ b/utils/parse_config.py @@ -9,8 +9,6 @@ def parse_model_cfg(path): if line.startswith('['): # This marks the start of a new block module_defs.append({}) module_defs[-1]['type'] = line[1:-1].rstrip() - if module_defs[-1]['type'] == 'convolutional': - module_defs[-1]['batch_normalize'] = 0 else: key, value = line.split("=") value = value.strip()