Getting Source Warning After Saving a Model

Hello,

When I save my whole LightningModel with MLFlow’s save_model() function and load with torch.load() function and export as a model.pth file I get

SourceChangeWarning: source code of class ‘torch.nn.modules.loss.CrossEntropyLoss’ has changed

This warning appears for other layers ( Conv2D, BatchNorm2D etc. ) as well. Is it about converting .ckpt file to .pth file ?

SourceChangeWarning: source code of class - #2 by smth - PyTorch Forums :laughing:

1 Like