About pytorch update

Hi all,

After I load a pytorch model, python give me this message,
~/anaconda2/lib/python2.7/site-packages/torch/serialization.py:304: SourceChangeWarning: source code of class 'torch.nn.modules.batchnorm.BatchNorm2d' has changed. you can retrieve the original source code by accessing the object's source attribute or settorch.nn.Module.dump_patches = Trueand use the patch tool to revert the changes.

Anybody know what this means?

Since the model structure is actually defined by the code, we’ve implemented a simple mechanism that saves the source code of each Module that you save, and when it’s loaded it compares it with the source that’s used to reinstantiate it. It’s meant to warn you that the model might now work differently, if you change your model code in the meantime.

I didn’t realize it also worked for built in modules, we’ll have to disable that. You can safely ignore the warning, and overwriting the old checkpoint with a new one will make it disappear. Also, we recommend serializing only the state dict.


Thanks for your help!