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

dcp压缩后,模型大小不变 #305

Open
huoguangdiandian opened this issue Aug 28, 2019 · 6 comments
Open

dcp压缩后,模型大小不变 #305

huoguangdiandian opened this issue Aug 28, 2019 · 6 comments

Comments

@huoguangdiandian
Copy link

您好,我无论在resnet还是mobilenet上,利用dcp通道剪枝后,模型大小始终不变,即使转成.pb文件也不变,但是模型测试相比原来有变化,请问这是什么原因呢

@yuanyuanli85
Copy link

This is because the channel not really pruned in dcp,instead those channels are masked. So, no reduction in model size

来自GitHub小程序客户端:

image

@huoguangdiandian
Copy link
Author

请问如果被屏蔽的通道没有去除会影响推理速度吗?能把那些屏蔽的通道能去除吗?

@huoguangdiandian
Copy link
Author

前提是我没有用框架里的程序转为.pb文件

@huoguangdiandian
Copy link
Author

This is because the channel not really pruned in dcp,instead those channels are masked. So, no reduction in model size

来自GitHub小程序客户端:

image

请问能得到压缩后的模型吗?

@yuanyuanli85
Copy link

可以获得压缩后的模型,但是需要稍复杂一点的操作,尤其对于有residual block的网络结构来说,比如resnet50. 你需要确保residual block中add的两个conv的pruned 通道一致,否则会出现错误。

@huoguangdiandian
Copy link
Author

PocketFlow框架里给出的例子,比如resnet18、lenet对于cifar10数据集训练模型,都能够直接得到压缩后的模型,而且模型大小也能根据剪枝通道比例获得,并没有经过复杂的操作,能解释一下吗?我现在用的网络是resnet18、50和mobilenetv1、v2,训练数据是从imagenet中随机挑选40类,非常感谢。。。

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

2 participants