当前位置:网站首页>pytorch 1.7. The model saved by X training cannot be loaded in version 1.4 or earlier
pytorch 1.7. The model saved by X training cannot be loaded in version 1.4 or earlier
2022-04-23 20:47:00 【NuerNuer】
pytorch1.6.x And higher , There is a difference between saving a model and a lower version , Therefore, the high version of the saved model fails to load in the low version :
We just need to be in a higher version torch When saving under , Set up _use_new_zipfile_serialization=False
weights = 'xxx.pth'
temp = torch.load(weights)
...
data = ... #type:OrderedDict
torch.save(data, 'new_model.pth', _use_new_zipfile_serialization=False)
About data The processing methods of models saved in different ways are not quite the same , Find out how your model is saved , For several common preservation forms, please refer to my blog :
https://blog.csdn.net/qq_41368074/article/details/120812819
A specific example can be referred to :
https://blog.csdn.net/flying_ant2018/article/details/115403774
版权声明
本文为[NuerNuer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210545523016.html
边栏推荐
- 一些接地气的话儿
- Bracket matching -- [implementation of one-dimensional array]
- CONDA environment management command
- Solve the Chinese garbled code of URL in JS - decoding
- How to do after winning the new debt? Is it safe to open an account online
- mmap、munmap
- Unity Odin ProgressBar add value column
- 2021-09-02 unity project uses rider to build hot change project failure record of ilruntime
- Unity solves Z-fighting
- 【SQL】字符串系列2:将一个字符串根据特定字符分拆成多行
猜你喜欢

Syntax Error: TypeError: this. getOptions is not a function

GO語言開發天天生鮮項目第三天 案例-新聞發布系統二

Solution: NPM err! code ELIFECYCLE npm ERR! errno 1

内网渗透之DOS命令

JS arrow function user and processing method of converting arrow function into ordinary function

Vscode download speed up

Leetcode 74. Search two-dimensional matrix

Leetcode 994, rotten orange

Reentrant function

On IRP from the perspective of source code
随机推荐
Win 11K in 100 days, super complete learning guide for job transfer test
Leetcode 232, queue with stack
UKFslam
go interface
Gsi-ecm digital platform for engineering construction management
Recommended usage scenarios and production tools for common 60 types of charts
LeetCode 116. 填充每个节点的下一个右侧节点指针
Summary and effect analysis of methods for calculating binocular parallax
Queue template code
Commande dos pour la pénétration de l'Intranet
Cmake project under vs2019: calculating binocular parallax using elas method
Case of the third day of go language development fresh every day project - news release system II
MySQL stored procedures and functions
Come in and teach you how to solve the problem of port occupation
How many hacking methods do you know?
Leetcode 542, 01 matrix
Matlab matrix index problem
Fastdfs mind map
Learn to C language fourth day
Selenium displays webdriverwait