Example #1
0
def deepbase_resnet101(num_classes=1000,
                       pretrained=None,
                       norm_type='batchnorm',
                       **kwargs):
    """Constructs a ResNet-101 model.
    Args:
        pretrained (bool): If True, returns a model pre-trained on Places
    """
    model = ResNet(Bottleneck, [3, 4, 23, 3],
                   num_classes=num_classes,
                   deep_base=True,
                   norm_type=norm_type)
    model = ModuleHelper.load_model(model, pretrained=pretrained)
    return model
Example #2
0
def resnet34(num_classes=1000,
             pretrained=None,
             norm_type='batchnorm',
             **kwargs):
    """Constructs a ResNet-34 model.
    Args:
        pretrained (bool): If True, returns a model pre-trained on Places
    """
    model = ResNet(BasicBlock, [3, 4, 6, 3],
                   num_classes=num_classes,
                   deep_base=False,
                   norm_type=norm_type)
    model = ModuleHelper.load_model(model, pretrained=pretrained)
    return model
Example #3
0
def resnet50(num_classes=1000,
             pretrained=None,
             norm_type='batchnorm',
             **kwargs):
    # def resnet50(num_classes=1000, pretrained=None, norm_type='encsync_batchnorm', **kwargs):
    """Constructs a ResNet-50 model.
    Args:
        pretrained (bool): If True, returns a model pre-trained on Places
    # """
    # print("entered")
    # input()
    model = ResNet(Bottleneck, [3, 4, 6, 3],
                   num_classes=num_classes,
                   deep_base=False,
                   norm_type=norm_type)
    model = ModuleHelper.load_model(model, pretrained=pretrained)
    return model