Pytorch way to preserve the two models
Black _7e1b
attention
13 words
read 5,907
Save only the model parameters
# 保存
torch.save(model.state_dict(), '\parameter.pkl')
# 加载
model = TheModelClass(...)
model.load_state_dict(torch.load('\parameter.pkl'))
Preserved model
# 保存
torch.save(model, '\model.pkl')
# 加载
model = torch.load('\model.pkl')
"Small gifts around and Jane book to my attention."
Appreciate the support
no one appreciates support what