Resnet_18.py
def resnet18(pretrained=False, **kwargs):
    """Constructs a ResNet-18 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
    model = ResNet(BasicBlock, [2, 2, 2], **kwargs)
    if pretrained:
        state = model.state_dict()
        loaded_state_dict = model_zoo.load_url(model_urls['resnet18'])
        for k in loaded_state_dict:
            if k in state:
                state[k] = loaded_state_dict[k]
        model.load_state_dict(state)
    return model
Constructs a ResNet-18 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    
Constructs a ResNet-18 model.
Constructs a ResNet - 18 model .
def resnet18(pretrained=False, **kwargs):
    model = ResNet(BasicBlock, [2, 2, 2], **kwargs)
    if pretrained:
        state = model.state_dict()
        loaded_state_dict = model_zoo.load_url(model_urls['resnet18'])
        for k in loaded_state_dict:
            if k in state:
                state[k] = loaded_state_dict[k]
        model.load_state_dict(state)
    return model
def resnet18 ( pretrained = False , ** kwargs ) : model = ResNet ( BasicBlock , [ 2 , 2 , 2 ] , ** kwargs ) if pretrained : state = model . state_dict ( ) loaded_state_dict = model_zoo . load_url ( model_urls [ 'resnet18' ] ) for k in loaded_state_dict : if k in state : state [ k ] = loaded_state_dict [ k ] model . load_state_dict ( state ) return model
Constructs a ResNet-18 model.
Constructs a ResNet - 18 model .
"""Constructs a ResNet-18 model.

    Args:
        pretrained (bool): If True, returns a model pre-trained on ImageNet
    """
pretrained
If True, returns a model pre-trained on ImageNet
If True returns a model pre - trained on ImageNet