当前位置:网站首页>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
边栏推荐
- PHP的Laravel与Composer部署项目时常见问题
- Awk print special characters
- Identifier CV is not defined in opencv4_ CAP_ PROP_ FPS; CV_ CAP_ PROP_ FRAME_ COUNT; CV_ CAP_ PROP_ POS_ Frames problem
- Commande dos pour la pénétration de l'Intranet
- Addition, deletion, modification and query of MySQL advanced table
- How to learn software testing? Self study or training? After reading this article, you will understand
- Preliminary understanding of cache elimination algorithm (LRU and LFU)
- LeetCode 1351、统计有序矩阵中的负数
- go struct
- C# 知识
猜你喜欢
一些接地气的话儿
Go language development Daily Fresh Project Day 3 Case - Press Release System II
Recommended usage scenarios and production tools for common 60 types of charts
2021-09-02 unity project uses rider to build hot change project failure record of ilruntime
JS arrow function user and processing method of converting arrow function into ordinary function
Common commands of MySQL in Linux
Plato farm is one of the four largest online IEOS in metauniverse, and the transaction on the chain is quite high
Vscode download speed up
Leetcode 542, 01 matrix
內網滲透之DOS命令
随机推荐
Matlab matrix index problem
Selenium displays webdriverwait
Easy to use nprogress progress bar
Parsing methods of JSON data in C - jar and jobobject: error reading jar from jsonreader Current JsonReader item
Leetcode 542, 01 matrix
go slice
GO語言開發天天生鮮項目第三天 案例-新聞發布系統二
Leetcode-279-complete square number
GSI-ECM工程建设管理数字化平台
Unity Odin ProgressBar add value column
Async function ------ ES6
Minecraft 1.12.2模组开发(四十三) 自定义盾牌(Shield)
Bash script learning -- for loop traversal
go array
MySQL进阶之常用函数
Unity asset import settings
Deep analysis of C language function
启牛学堂有用吗,推荐的证券账户是否安全
laravel 发送邮件
PHP的Laravel与Composer部署项目时常见问题