Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi, How do you resume from best_model.pt? #19

Open
ross-Hr opened this issue Aug 9, 2023 · 0 comments
Open

Hi, How do you resume from best_model.pt? #19

ross-Hr opened this issue Aug 9, 2023 · 0 comments

Comments

@ross-Hr
Copy link

ross-Hr commented Aug 9, 2023

Hello,

For some reason my machine lost power during training.
Is it possible to resume the previous training from best_model.pt ?

I realized #13 (comment) didn't solve the problem complete...

My rough code:

   if RESUME_LOCAL_PATH is not None:
        ckpoint = torch.load(RESUME_LOCAL_PATH)
        optimizer.state_dict().update(ckpoint['optimizer_state_dict'])
   
   ......

   state_dict = torch.load(RESUME_LOCAL_PATH )
   state_dict = intersect_dicts(
                state_dict,
                model.state_dict(),
                exclude=["anchor"],
            )

   model.load_state_dict(state_dict, strict=False)

I'm not sure if I'll be able to get back to my previous training.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant