glow-pytorch icon indicating copy to clipboard operation
glow-pytorch copied to clipboard

load checkpoints

Open eyalbetzalel opened this issue 5 years ago • 3 comments

Hi!

Great code, thanks for sharing.

How can I use checkpoint files in order to continue training sessions after pausing?

Eyal

eyalbetzalel avatar May 23 '20 14:05 eyalbetzalel

You can use model.load_state_dict(torch.load('CHECKPOINT_PATH', map_location=lambda storage, loc: storage)) at this line https://github.com/rosinality/glow-pytorch/blob/master/train.py#L164.

rosinality avatar May 23 '20 22:05 rosinality

I guess that the next line should be at :

https://github.com/rosinality/glow-pytorch/blob/master/train.py#L166.

optimizer.state_dict(torch.load('checkpoint/optim_012001.pt', map_location=lambda storage, loc: storage))

Am I right?

eyalbetzalel avatar May 31 '20 20:05 eyalbetzalel

Yes, if you want to load optimizer states too.

rosinality avatar May 31 '20 23:05 rosinality