Exemple #1
0
def create_model(args):
    model = Net()
    if args.start_epoch:
        path = os.path.join(args.checkpoints_dir,
                            f'checkpoint-{args.start_epoch}.pth')
        model.load_state_dict(torch.load(path))
    else:
        model.load_pretrained(args.ddr_weights)
    return model.to(args.device)
Exemple #2
0
def create_model(args):
    model = Net()
    model.load_pretrained(args.weights)
    return model.to(args.device)