Example #1
0
    # model.eval()
    # print('Complete !')

    optimizer = optim.Adam(model.parameters(), lr=args.lr)
    scheduler = None

    model_cond = poseVQVAE().to(device)
    model_cond = nn.DataParallel(model_cond).cuda()
    print('Loading Model...', end='')
    model_cond.load_state_dict(
        torch.load('/p300/mem/mem_src/checkpoint/pose_04/vqvae_462.pt'))
    model_cond.eval()
    print('Complete !')
    optimizer_cond = optim.Adam(model_cond.parameters(), lr=args.lr)

    model_D = MultiscaleDiscriminator(input_nc=3).to(device)
    model_D = nn.DataParallel(model_D).cuda()
    optimizer_D = optim.Adam(model_D.parameters(), lr=args.lr)
    # if args.sched == 'cycle':
    #     scheduler = CycleScheduler(
    #         optimizer, args.lr, n_iter=len(loader) * args.epoch, momentum=None
    #     )

    dic_model = {
        'model_img': model,
        'model_cond': model_cond,
        # 'model_transfer': model_transfer,
        'model_D': model_D,
        'optimizer_img': optimizer,
        'optimizer_cond': optimizer_cond,
        # 'optimizer_transfer': optimizer_transfer
Example #2
0
    model.load_state_dict(torch.load('/p300/mem/mem_src/SPADE/checkpoint/as_101/vqvae_072.pt'))
    model.eval()
    print('Complete !')

    optimizer = optim.Adam(model.parameters(), lr=args.lr)
    scheduler = None

    model_cond = poseVQVAE().to(device)
    model_cond = nn.DataParallel(model_cond).cuda()
    print('Loading Model_condition...', end='')
    model_cond.load_state_dict(torch.load('/p300/mem/mem_src/checkpoint/pose_06_black/vqvae_016.pt'))
    model_cond.eval()
    print('Complete !')
    optimizer_cond = optim.Adam(model_cond.parameters(), lr=args.lr)

    model_D = MultiscaleDiscriminator(input_nc=3).to(device)
    model_D = nn.DataParallel(model_D).cuda()
    print('Loading Model_D...', end='')
    model_D.load_state_dict(torch.load('/p300/mem/mem_src/SPADE/checkpoint/as_101/vqvae_D_072.pt'))
    model_D.eval()
    print('Complete !')
    optimizer_D = optim.Adam(model_D.parameters(), lr=args.lr)
    # if args.sched == 'cycle':
    #     scheduler = CycleScheduler(
    #         optimizer, args.lr, n_iter=len(loader) * args.epoch, momentum=None
    #     )

    dic_model = {'model_img': model, 'model_cond': model_cond,
                 # 'model_transfer': model_transfer,
                 'model_D': model_D,
                 'optimizer_img': optimizer, 'optimizer_cond': optimizer_cond,
Example #3
0
    model.eval()
    print('Complete !')

    optimizer = optim.Adam(model.parameters(), lr=args.lr)
    scheduler = None

    model_cond = poseVQVAE().to(device)
    model_cond = nn.DataParallel(model_cond).cuda()
    print('Loading Model_condition...', end='')
    model_cond.load_state_dict(
        torch.load('/p300/mem/mem_src/checkpoint/pose_04/vqvae_462.pt'))
    model_cond.eval()
    print('Complete !')
    optimizer_cond = optim.Adam(model_cond.parameters(), lr=args.lr)

    model_D = MultiscaleDiscriminator(input_nc=3).to(device)
    model_D = nn.DataParallel(model_D).cuda()
    print('Loading Model_D...', end='')
    model_D.load_state_dict(
        torch.load('/p300/mem/mem_src/SPADE/checkpoint/as_90/vqvae_D_121.pt'))
    model_D.eval()
    print('Complete !')
    optimizer_D = optim.Adam(model_D.parameters(), lr=args.lr)
    # if args.sched == 'cycle':
    #     scheduler = CycleScheduler(
    #         optimizer, args.lr, n_iter=len(loader) * args.epoch, momentum=None
    #     )

    dic_model = {
        'model_img': model,
        'model_cond': model_cond,