Exception has occurred: UnpicklingError
A load persistent id instruction was encountered, but no persistent_load function was specified.
运行torch.load() 时报错,原因是保存和加载模型时的pytorch版本不一致导致的,换用一致的版本即可。
本文探讨了在使用torch.load()时遇到的UnpicklingError异常,详细解释了该错误的原因在于保存与加载模型时使用的PyTorch版本不一致,并提供了解决方案:确保使用相同版本的PyTorch进行模型的保存与加载。
Exception has occurred: UnpicklingError
A load persistent id instruction was encountered, but no persistent_load function was specified.
运行torch.load() 时报错,原因是保存和加载模型时的pytorch版本不一致导致的,换用一致的版本即可。

被折叠的 条评论
为什么被折叠?
