How to save the model?
haibao-yu opened this issue · comments
Hi,
When I set the BasicBlock's option as "A" and save the model with following code:
torch.save(model, 'test.pkl')
,
here is the error:
"AttributeError: Can't pickle local object 'BasicBlock.init..'"
What's problem?
Thanks!
it is not recommended to save model, you should save model's state instead:
torch.save(model.state_dict(), 'test.pkl")