From a7e8cadd1523b1e05f76e188dc97ed51983b529d Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Wed, 3 Jun 2020 17:13:52 -0700 Subject: [PATCH] Remove pointless densenet configs, add an iabn version of 264 as it makes more sense to try someday... --- timm/models/densenet.py | 52 +++++++++++------------------------------ 1 file changed, 13 insertions(+), 39 deletions(-) diff --git a/timm/models/densenet.py b/timm/models/densenet.py index d8edacd7..59a15a85 100644 --- a/timm/models/densenet.py +++ b/timm/models/densenet.py @@ -39,6 +39,7 @@ default_cfgs = { 'densenet201': _cfg(url='https://download.pytorch.org/models/densenet201-c1103571.pth'), 'densenet161': _cfg(url='https://download.pytorch.org/models/densenet161-8d451a50.pth'), 'densenet264': _cfg(url=''), + 'densenet264d_iabn': _cfg(url=''), 'tv_densenet121': _cfg(url='https://download.pytorch.org/models/densenet121-a639ec97.pth'), } @@ -331,45 +332,6 @@ def densenet121d(pretrained=False, **kwargs): return model -@register_model -def densenet121d_evob(pretrained=False, **kwargs): - r"""Densenet-121 model from - `"Densely Connected Convolutional Networks" ` - """ - def norm_act_fn(num_features, **kwargs): - return create_norm_act('EvoNormBatch', num_features, jit=True, **kwargs) - model = _densenet( - 'densenet121d', growth_rate=32, block_config=(6, 12, 24, 16), stem_type='deep', - norm_layer=norm_act_fn, pretrained=pretrained, **kwargs) - return model - - -@register_model -def densenet121d_evos(pretrained=False, **kwargs): - r"""Densenet-121 model from - `"Densely Connected Convolutional Networks" ` - """ - def norm_act_fn(num_features, **kwargs): - return create_norm_act('EvoNormSample', num_features, jit=True, **kwargs) - model = _densenet( - 'densenet121d', growth_rate=32, block_config=(6, 12, 24, 16), stem_type='deep', - norm_layer=norm_act_fn, pretrained=pretrained, **kwargs) - return model - - -@register_model -def densenet121d_iabn(pretrained=False, **kwargs): - r"""Densenet-121 model from - `"Densely Connected Convolutional Networks" ` - """ - def norm_act_fn(num_features, **kwargs): - return create_norm_act('iabn', num_features, **kwargs) - model = _densenet( - 'densenet121tn', growth_rate=32, block_config=(6, 12, 24, 16), stem_type='deep', - norm_layer=norm_act_fn, pretrained=pretrained, **kwargs) - return model - - @register_model def densenet169(pretrained=False, **kwargs): r"""Densenet-169 model from @@ -410,6 +372,18 @@ def densenet264(pretrained=False, **kwargs): return model +@register_model +def densenet264d_iabn(pretrained=False, **kwargs): + r"""Densenet-264 model with deep stem and Inplace-ABN + """ + def norm_act_fn(num_features, **kwargs): + return create_norm_act('iabn', num_features, **kwargs) + model = _densenet( + 'densenet264d_iabn', growth_rate=48, block_config=(6, 12, 64, 48), stem_type='deep', + norm_layer=norm_act_fn, pretrained=pretrained, **kwargs) + return model + + @register_model def tv_densenet121(pretrained=False, **kwargs): r"""Densenet-121 model with original Torchvision weights, from