Hi, here is the code i use resume:

save_checkpoint({
‘epoch’: epoch + 1,
‘arch’: str(model),
‘state_dict’: model.state_dict(),
‘best_acc’: best_acc,
‘optimizer’ : optimizer.state_dict(),
}, is_best, filenameCheckpoint, filenameBest)


if args.resume:
    if enc:
        filenameCheckpoint = savedir + '/checkpoint_enc.pth.tar'
    else:
        filenameCheckpoint = savedir + '/checkpoint.pth.tar'

    assert os.path.exists(filenameCheckpoint), "Error: resume option was used but checkpoint was not found in folder"
    checkpoint = torch.load(filenameCheckpoint)
    start_epoch = checkpoint['epoch']
    model.load_state_dict(checkpoint['state_dict'])
    optimizer.load_state_dict(checkpoint['optimizer'])
    best_acc = checkpoint['best_acc']
    print("=> Loaded checkpoint at epoch {})".format(checkpoint['epoch']))


In the code, maybe i have save the state_dict, so i also don’t know how to solve this problem.
About the training break, it is normal for me. Because i use a free machine from my school. It will break every 10 hours. I know it’s hurt, but i can’t do something for that.
Thank you.