-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some questions about quantization #85
Comments
有任何進展嗎 |
@twmht |
你这边尝试的结论是否是: 也就是说RepVGG训练出来的模型不适合QAT的量化,只要用PTQ就行了~~ |
可以試試把 repvgg 的模型弄得更小一點,看做 PTQ 精度會不會掉? |
是的 但我的实验不够完备,可以在实践的时候再尝试一下~ |
@Desmond-97 请问你在做PTQ的时候有再用insert_bn吗?我发现直接convert后的单路repvgg的网络参数范围比较大,导致量化误差也大。 |
你 PTQ 用 TensorRT 的還是哪個 framework? |
我是用的有一篇工作BRECQ里边的PTQ。用的fake quantization。 |
@hobbitlzy 没有用insert_bn。 |
您好,我在量化RepVGG到INT8时遇到一些问题:
完全按照您在README中提到的量化流程,先插入BN后QAT量化,掉点非常严重。以大模型(b3g4)为例,在ImageNet分类任务上量化后仅有20左右的accuracy。
但假如将https://github.com/DingXiaoH/RepVGG/blob/ce669bad170bf5d7c2a9eb060e90f39e7e109130/quantization/repvgg_quantized.py#L50代码修改为:` torch.quantization.fuse_modules(m, ['conv'], inplace=True)`
可以直接运行QAT量化,则掉点只有2.7%,调参后掉点大约1.7%。(参数为epochs=20 batch_size:与训练时bs保持一致 lr=1e-3 weight_decay=55e-6)
但对于分类任务而言量化后掉点也有点多,不知道这样做是否正确?请问您有其他量化方法的见解吗?
The text was updated successfully, but these errors were encountered: