Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

save and load model during training pytorch

state = {
    'epoch': epoch,
    'state_dict': model.state_dict(),
    'optimizer': optimizer.state_dict(),
    ...
}
torch.save(state, filepath)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #save #load #model #training #pytorch
ADD COMMENT
Topic
Name
7+3 =