当前位置:网站首页>【Bug解决】UnpicklingError: A load persistent id instruction was encountered, but no persistent_load.
【Bug解决】UnpicklingError: A load persistent id instruction was encountered, but no persistent_load.
2022-06-11 19:29:00 【zstar-_】
问题环境
在将pytorch本地训练好的模型,传到jetson nano平台上,加载模型时,报了这个错误:
UnpicklingError: A load persistent id instruction was encountered, but no persistent_load.
问题原因
查阅相关资料,这是由于pytorch在1.6.0版本之后,模型保存默认方式是压缩的形式,而在jetson nano版本上的pytorch版本是1.0.0,因此无法直接加载.pth文件。
用下面的方式可以查看pytorch的版本:
import torch
print(torch.__version__)
问题解决
设置保存模型时不进行压缩,即修改保存模型语句为:
torch.save(model.state_dict(), MODEL_PATH, _use_new_zipfile_serialization=False)
边栏推荐
- CMU 15-445 database course lesson 5 text version - buffer pool
- 556. next larger element iii- (31. next permutation) - two iterations
- YOLOv3 Pytorch代码及原理分析(二):网络结构和 Loss 计算
- What started mongodb? What are the application scenarios?
- On high availability architecture
- Unsupervised image classification code analysis notes of scan:learning to classify images without (1): simclr
- Raki's notes on reading paper: memory replace with data compression for continuous learning
- High performance architecture design
- Automated test requirements analysis
- 【Multisim仿真】利用运算放大器产生方波、三角波发生器
猜你喜欢
![[signal denoising] signal denoising based on FFT and fir with matlab code](/img/4c/782afe2652a674d64fccd8d28304ed.png)
[signal denoising] signal denoising based on FFT and fir with matlab code

Find the maximum 3 same digits in the string

《经济学人》:WTO MC12重启 数字经济成为全球经济复苏和增长的核心引擎
![[untitled]](/img/02/49d333ba80bc6a3e699047c0c07632.png)
[untitled]

AHB2APB_bridge 设计

Postman configuration Chinese

Gmail: how do I recall an outgoing message?

Neural network and deep learning-2-simple example of machine learning pytorch

CMU 15 - 445 cours de base de données Leçon 5 version texte - Pool tampon

图床:PicGo+腾讯云+typora
随机推荐
Activate function formulas, derivatives, image notes
[Lao Wang's fallacy of brain science] Why do blind people "seem" to be more "sensitive" than normal people?
MongoDB 什么兴起的?应用场景有哪些?
Detailed explanation of iSCSI (IV) -- actual configuration of iSCSI server
Cf:c. restoring the duration of tasks
RTL仲裁器设计
Merge multiple binary search trees
On the translation of rich text storage database format
01. Telecommunications_ Field business experience
司空见惯 - 会议室名称
MySQL federated index and BTREE
[image segmentation] image segmentation based on Markov random field with matlab code
[signal denoising] speech adaptive denoising based on nonlinear filter with matlab code
What started mongodb? What are the application scenarios?
Pyqt5 tips - button vertical display method, QT designer sets button vertical display.
Pyramid test principle: 8 tips for writing unit tests
程序员10年巨变,一切都变了又好像没变...
Web3 Games: exploring and reshaping the game experience
谷歌提出超强预训练模型CoCa,在ImageNet上微调Top-1准确率达91%!在多个下游任务上SOTA!...
[assembly] analysis of Experiment 7 of the fourth edition of assembly language