I’m trying to save SGD Optimizer 14 state using
torch.save(optimizer.state_dict(), 'optim.pth')  and then loading it with  optimizer.load_state_dict(torch.load('optim.pth'))
But after loading the state, optimizer.step() gives error for in sgd.py 7 for following line
if momentum != 0:
      param_state = self.state[p]

This is probably because it doesn't save the dictionary used by [optimizer](https://github.com/pytorch/pytorch/blob/master/torch/optim/optimizer.py)
So I tried using `torch.save(optimizer, 'optim.pth')` but then the network simply doesn't train at all.
So what' the correct way of saving and loading SGD optimizer (while using momentum) ?