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

Merge conv2d and bn #8

Open
zptang1210 opened this issue Apr 1, 2021 · 4 comments
Open

Merge conv2d and bn #8

zptang1210 opened this issue Apr 1, 2021 · 4 comments

Comments

@zptang1210
Copy link

I am using your model to do segmentation, and its performance is really amazing. However, the inference speed is not ideal. I noticed that you merged conv2d and batchnorm during inference. This is probably the potential reason for low speed. However, after I started to work on this, I realized this is not easy work. Could you provide us with the source code for merging conv2d and batchnorm? Thanks in advance!

@ydhongHIT
Copy link
Owner

I am using your model to do segmentation, and its performance is really amazing. However, the inference speed is not ideal. I noticed that you merged conv2d and batchnorm during inference. This is probably the potential reason for low speed. However, after I started to work on this, I realized this is not easy work. Could you provide us with the source code for merging conv2d and batchnorm? Thanks in advance!

The official Pytorch has provided this method in https://github.com/pytorch/pytorch/blob/master/torch/nn/utils/fusion.py.

@zptang1210
Copy link
Author

Thanks for your reply! I know that pytorch has incorporated that function, but it seems that I need to rewrite your model structure with all consecutive conv2ds and bns replaced by conv2ds, and then copy the pre-trained parameters to the new model structure. Is there any easier way to convert the pre-trained model to the new model structure?

@DirtyBit64
Copy link

I am using your model to do segmentation, and its performance is really amazing. However, the inference speed is not ideal. I noticed that you merged conv2d and batchnorm during inference. This is probably the potential reason for low speed. However, after I started to work on this, I realized this is not easy work. Could you provide us with the source code for merging conv2d and batchnorm? Thanks in advance!

我融合了,但只提升了一些,在2080ti上可达60多fps,和作者提供的eval_speed.py测出来的差不多,我想论文中说的101fps可能是trt加速后的吧

@JAYCHUS
Copy link

JAYCHUS commented Sep 24, 2024

I am using your model to do segmentation, and its performance is really amazing. However, the inference speed is not ideal. I noticed that you merged conv2d and batchnorm during inference. This is probably the potential reason for low speed. However, after I started to work on this, I realized this is not easy work. Could you provide us with the source code for merging conv2d and batchnorm? Thanks in advance!

我融合了,但只提升了一些,在2080ti上可达60多fps,和作者提供的eval_speed.py测出来的差不多,我想论文中说的101fps可能是trt加速后的

你好 请问ddrnet您在camvid数据集上跑通了吗 请问可以分享一下 datasets/camvid.py 和camvid 的yaml文件吗 感谢感谢 期待回复

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

No branches or pull requests

4 participants