Loading optimizer from checkpoint

I encountered this issue with loading an optimizer from a checkpoint today: https://github.com/pytorch/pytorch/issues/2830

Is this comment still the preferred way to address the issue? https://github.com/pytorch/pytorch/issues/2830#issuecomment-336194949

No. If you read further, you will notice that you now can just recreate and load state after this PR: https://github.com/pytorch/pytorch/pull/3658

Weird that I still encounter the error without casting then. Could it be that some of the binaries are stale? This is the version I have:

>>> import torch
>>> torch.__version__
'0.3.0'

I realized I was using conda install -y pytorch torchvision cuda80 -c soumith in my bootstrap script, while I should’ve been using conda install pytorch torchvision -c pytorch as per the instructions. I now have

>>> import torch
>>> torch.__version__
'0.3.0.post4'

but still encounter the error.