How to load weights which was trained older version of PyTorch?

Hi,

I trained a RoBERTa model on PyTorch 1.6 and tried to load the weights on different server which had PyTorch 1.4.

But I could not load the weights and got an error which said,

OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. 

I can upgrade PyTorch which is not a problem but I’m curious how can I load weights trained on older version of PyTorch?

Environments of both servers:
ubuntu: 18.04 ( both servers )
transformers: 3.1.0 ( both servers )
Python 3.7.9 and Python 3.7.3

Thanks in advance.

1 Like