当前位置:网站首页>[pytoch] quantification
[pytoch] quantification
2022-06-24 14:18:00 【. Yun Zhe】
#-*- coding:utf-8 -*-
import torch
# Quantification is only available cpu
model = ResNet().cpu()
model = torch.load_state_dict(torch.load(weights))
#Specify quantization configuration
# In this step, symmetric quantization or asymmetric quantization is declared , And quantification bit Count
# The following code uses the default asymmetric quantization , And 8bit
model.qconfig = torch.quantization.default_qconfig
model = torch.quantization.prepare(model)
#Convert to quantized model
model = torch.quantization.convert(model)
#Save model, After saving the model size Significantly reduce , But the performance loss is relatively large
# so , It is suggested to consider quantitative perception training
torch.save(model.state_dict(), "path.pt")
边栏推荐
- HarmonyOS.2
- Mit-6.824-lab4a-2022 (ten thousand words explanation - code construction)
- JS remove string spaces
- 在CVS中恢复到早期版本
- Kunpeng arm server compilation and installation paddlepaddle
- 3环杀掉360安全卫士进程
- leetcode:1504. Count the number of all 1 sub rectangles
- 90% of the project managers have skipped the pit. Are you still in the pit?
- 10_那些格調很高的個性簽名
- PgSQL queries the largest or smallest data of a field in a group
猜你喜欢

港股上市公司公告 API 数据接口

ASCII code table extracted from tanhaoqiang's C program design (comparison table of common characters and ASCII codes)
![Maximum path sum in binary tree [handle any subtree, then handle the whole tree]](/img/d0/91ab1cc1851d7137a1cab3cf458302.png)
Maximum path sum in binary tree [handle any subtree, then handle the whole tree]

leetcode:1504. Count the number of all 1 sub rectangles

如何避免下重复订单
![[untitled]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled]

Py之toad:toad的简介、安装、使用方法之详细攻略

P2pdb white paper

Harmony os. (2)

GO语言并发模型-MPG模型
随机推荐
Kotlin shared mutable state and concurrency
在线文本实体抽取能力,助力应用解析海量文本数据
从谭浩强《C程序设计》上摘录的ASCII码表(常用字符与ASCII代码对照表)
Maximum path sum in binary tree [handle any subtree, then handle the whole tree]
智源社区周刊#86:Gary Marcus谈大模型研究可借鉴的三个语言学因素;谷歌提出媲美Imgen的文生图模型Parti;OpenAI提出视频预训练模型VPT,可玩MC游戏
js去除字符串空格
Puzzle (016.2) finger painting Galaxy
4 reasons for "safe left shift"
Common singleton mode & simple factory
[deep learning] storage form of nchw, nhwc and chwn format data
HarmonyOS-3
R语言plotly可视化:可视化模型在整个数据空间的分类轮廓线(等高线)、meshgrid创建一个网格,其中每个点之间的距离由mesh_size变量表示、使用不同的形状标签表征、训练、测试及分类标签
常见的单例模式&简单工厂
Promotion of Project Manager
高薪程序员&面试题精讲系列115之Redis缓存如何实现?怎么发现热key?缓存时可能存在哪些问题?
业务与技术双向结合构建银行数据安全管理体系
港股上市公司公告 API 数据接口
Kunpeng arm server compilation and installation paddlepaddle
鲲鹏arm服务器编译安装PaddlePaddle
The difference between V-IF and v-show