kailigo / pacl

PyTroch Implementation of the following paper, "ECACL: A Holistic Framework for Semi-Supervised Domain Adaptation, ICCV'21""

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some error on resuming training from checkpoint

e96031413 opened this issue · comments

Hello, thanks for your great work, I found some error in the main.py

I have attached the right version below:

  • parser should look like this to load the checkpoint.
parser.add_argument('--resume', default='', type=str, metavar='PATH',
                    help='path to latest checkpoint (default: none)')
  • when loading the model, we should use the correct checkpoint name.
if args.resume:
    if os.path.isfile(args.resume):
        print("=> loading checkpoint '{}'".format(args.resume))
        
        checkpoint = torch.load(args.resume)
        start_step = checkpoint['step']
        # best_acc = checkpoint['best_acc']

        G.load_state_dict(checkpoint['state_dict_G'])
        optimizer_g.load_state_dict(checkpoint['optimizer_G'])   # checkpoint['optimizer_g'] in your code 

        F1.load_state_dict(checkpoint['state_dict_F'])           # checkpoint['state_dict_G'] in your code
        optimizer_f.load_state_dict(checkpoint['optimizer_f'])  

Thanks, we will revise accordingly.