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

[save the entire model failed]

Open HongChow opened this issue 5 years ago • 2 comments

load and inference work ok. and I am trying to save the entire model (including both architecture and weights),but failed. in detail,torch.save(net,'mb_v1_ssd_all.pth') when run the code, it failed , the error information : TypeError: can't pickle module objects ( we can save weights only successfully by : torch.save(net.state_dict(),'mb_v1_ssd.pth'))

For some purpose , i must save the entire model now. Is anyone encountered the same problem? or could someone give me some idea?

HongChow avatar Mar 05 '19 04:03 HongChow

plz save the net.state_dict()

qfgaohao avatar Apr 16 '19 22:04 qfgaohao

@q

plz save the net.state_dict()

why using torch.save(net, path) doesn't work. In my case, I also need to save whole model. How can I save whole model

CharlieXie avatar May 19 '20 09:05 CharlieXie