Comments (8)
这个训练量化程序保存的模型参数形式是正常的浮点,但在训练过程中模拟了量化过程,即保存的这个参数其实已经是量化了的。可以再用个脚本提取参数(运行训练量化程序中的量化部分)来变成量化形式,8bits变为[0, 255]的整数,三值/二值变为+-1、0,可用于终端部署。WbWtAb-bn_merge-bn_merge.py中就做了这个参数提取,可以参考
from micronet.
这个训练量化程序保存的模型参数形式是正常的浮点,但在训练过程中模拟了量化过程,即保存的这个参数其实已经是量化了的。可以再用个脚本提取参数(运行训练量化程序中的量化部分)来变成量化形式,8bits变为[0, 255]的整数,三值/二值变为+-1、0,可用于终端部署。WbWtAb-bn_merge-bn_merge.py中就做了这个参数提取,可以参考
我是可以理解成量化操作最后数值是量化后的数值,但是保存方式是浮点型。现在torch官方支持qint8类型,三值、二值是不是难以工程部署使用。
from micronet.
@Greyman-Seu, @666DZY666 , 并没有看到WbWtAb/bn_merge/bn_merge.py呀
大神我刚试了bn_folding.py, 但是model.pth和quan_model_para.pth都是2.4M,还是没有减小
from micronet.
@666DZY666 大佬你好,bnfuse的pth读取后内部仍是浮点型,没有变成整数,请问是需要不同的操作吗
from micronet.
请问问怎么让这个·pth文件变小呢
from micronet.
如果要实现变成整数的weight和bias,是否可以按照量化公式,用pth中的scale,zero_point来得到量化中间值呢?
from micronet.
from micronet.
@666DZY666 @tengshaofeng @Greyman-Seu @Icey-Liu @YangNuoCheng 麻烦问下,怎么将通过二值权重和特征方式训练的模型保存为二值的模型呢?现在保存的还是浮点型的,模型的大小未发生变化,
参照bn_fuse.py中的处理,处理之后保存的模型依然是浮点型的;
用的网络是nin.py的结构,麻烦问下要怎么转换为二值的呢?
from micronet.
Related Issues (20)
- yolov5量化实验 HOT 1
- weight量化问题
- 关于后训练量化的疑惑,真真诚诚希望得到解答 HOT 1
- 关于反卷积和BN层融合的疑惑 HOT 1
- WQ的max_val为什么是 (1 << self.bits) - 2)?
- 关于是否有必要添加输出量化的问题? HOT 1
- 修改成自己模型后遇到的问题
- Can you add an English version please?
- 模型压缩数据对比,没有指出是wbwtab 还是wqaq训练的?
- wbwtab下的bn_fuse 设置问题
- zero_point 求法
- 请求帮助,模型量化时是一定要重新手动创建一个量化的模型类脚本吗。
- modify weight/activation
- nin_gc网络,在add_quant_op()函数中为什么没有通道拆分并transpose,再reshape? HOT 1
- 请问压缩之后的网络可以直接拿来在pytorch上做inference嘛? HOT 1
- 量化导入自己pth模型时候出现 KeyError: 'state_dict' HOT 1
- Dorefa训练的反向传播 HOT 1
- nin_gc训练一段step后,loss变很大很大 HOT 2
- 采用迁移的dorefa方法的量化训练问题
- 模型·大小对比 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micronet.