Skip to content
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

[Bug] 模型量化bug #1851

Closed
justld opened this issue Mar 9, 2022 · 1 comment
Closed

[Bug] 模型量化bug #1851

justld opened this issue Mar 9, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@justld
Copy link
Contributor

justld commented Mar 9, 2022

使用paddleseg进行模型量化时,发现一个bug,代码链接:

quant_model = quantizer.quantize(model)

,根据paddleslim(2.0.0)文档,量化模型是inplace的,没有返回值,quant_model = None,所以paddleseg量化时会报错“NoneType object has no attribution 'train'”。
paddleslim(2.0.0)文档:
https://paddleslim.readthedocs.io/zh_CN/develop/api_cn/dygraph/quanter/qat.html
paddleslim(2.0.0)源码:https://github.com/PaddlePaddle/PaddleSlim/blob/c2cbef1afaeca836c7551427ebd31c6889b56f8f/paddleslim/dygraph/quant/quanter.py#L217

修改:

quantizer.quantize(model) 
quant_model = model

env:
aistudio 至尊gpu版本

PaddleSeg version: release/2.4
PaddlePaddle version: PaddlePaddle 2.2.2
Operation system: Linux

@justld justld added the bug Something isn't working label Mar 9, 2022
@juncaipeng juncaipeng self-assigned this Mar 9, 2022
@juncaipeng
Copy link
Collaborator

Fix by the above PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants