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

关于如何将conv和bn层进行合并的问题 #218

Closed
xiaopengaia opened this issue Nov 28, 2022 · 3 comments
Closed

关于如何将conv和bn层进行合并的问题 #218

xiaopengaia opened this issue Nov 28, 2022 · 3 comments
Labels

Comments

@xiaopengaia
Copy link

嗨 大家好,

今天在做resnet50量化的时候,想将conv层和bn层进行合并,然后进行量化

为此我找到了fuser_method_mappings.py这个文件

同时调用了fuse_conv_freezebn这个函数

但在进行合并的时候,发现需要将网络中的conv和bn单独提取处理来,进行合并

显然,这样操作似乎过于麻烦些

因此,我尝试寻找r50_8_8.yaml中能够针对conv和bn相互融合的参数,未果

想请教大家是如何合并bn和conv层的

有没有较好的简便的方法,或者在r50_8_8.yaml是否有参数能够进行处理呢?

希望得到指正,谢谢大家!

@aksenventwo
Copy link

转换模型后在进行校准或者训练前可以调用这个方法

def convert_merge_bn(model: GraphModule, **kwargs):

@xiaopengaia
Copy link
Author

非常感谢您的回复。我尝试下。

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

This issue has not received any updates in 120 days. Please reply to this issue if this still unresolved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants