UER-py icon indicating copy to clipboard operation
UER-py copied to clipboard

Using a low version of pytorch to load a model saved with a high version of pytorch (1.6+) will report an error

Open hhou435 opened this issue 3 years ago • 1 comments

xxx.pt is a zip archive(did you mean to use torch.jit.load()?

hhou435 avatar Mar 01 '22 03:03 hhou435

https://pytorch.org/tutorials/beginner/saving_loading_models.html

The 1.6 release of PyTorch switched torch.save to use a new zipfile-based file format. torch.load still retains the ability to load files in the old format. If for any reason you want torch.save to use the old format, pass the kwarg _use_new_zipfile_serialization=False.

zhezhaoa avatar Mar 07 '22 12:03 zhezhaoa