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.
for i in os.listdir(models_old_path): state_dict = torch.load(os.path.join(models_old_path, i), map_location="cpu") torch.save(state_dict, os.path.join(models_new_path, i), _use_new_zipfile_serialization=False) print(i, 'saved')
The domain name of this website has been changed to triority.cc(Using CDN via cloudflare, recommended) / www.triority.cc(Connecting directly, works better in Chinese mainland). Please contact me if you have any questions.