I’m using torch.save to save my model and I find that when I save it in one file, the size is about 24 MB. while I save each parameter in a single file,the sum of the sizes is about 50MB. Why does this happen?
model = Net()
torch.save(model.state_dict(),'model.pth')
# 24 MB
model = torch.load('model.pth')
for k,v in model.items():
torch.save(v,k+'.pth')
# sum of sizes is 50 MB
Thanks a lot.