import torch


def load_checkpoint(filename, load_dir):
    """
    Loads a saved model
    Arugments:
        filename (str) : name of file in load_dir
    Returns
        model : saved model in filename
    """
    checkpoint = torch.load(load_dir + filename)
    model = checkpoint['model']
    model.load_state_dict(checkpoint['state_dict'])
    #for parameter in model.parameters():
    #    parameter.requires_grad = False
    #model.eval()
    return model