PaddleSlim icon indicating copy to clipboard operation
PaddleSlim copied to clipboard

小白的剪枝问题

Open TANSHOUTAO opened this issue 3 years ago • 5 comments

敏感度分析完后,怎么确定剪枝的层和剪枝率,因为介绍用python绘制的话该怎么做,那个网页404了

TANSHOUTAO avatar Mar 17 '22 02:03 TANSHOUTAO

您好,可以请教一下您是怎么进行敏感度分析的吗? 是否参考的这个文档: https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.4/static/slim/sensitive

bbilixzc avatar Apr 01 '22 12:04 bbilixzc

是的,我参考的就是这个文档,我用的是2.1的版本,现在有一个新的问题一直没有办法解决,就是用这种办法分析敏感度时,对于ssd_mobilenet_voc模型的dw卷积层没有办法分析,会出现报错的情况,其他层却没有,可以正常分析并且进行剪枝,请问是什么问题,有没有什么解决办法,或者在静态图里面有没有分析敏感度的方式,感谢回复!!

------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleSlim" @.>; 发送时间: 2022年4月1日(星期五) 晚上8:16 @.>; @.>;"State @.>; 主题: Re: [PaddlePaddle/PaddleSlim] 小白的剪枝问题 (Issue #1018)

您好,可以请教一下您是怎么进行敏感度分析的吗? 是否参考的这个文档: https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.4/static/slim/sensitive

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

TANSHOUTAO avatar Apr 02 '22 00:04 TANSHOUTAO

感谢回复!

但是我使用2.1版本的Paddle Detection去跑敏感度分析的脚本,还是有报这个错误:ImportError: cannot import name 'create_reader' from 'ppdet.data.reader';不知道您是否有遇到过? 1648862177(1)

对于dw层不能进行分析:我的看法是depth wise卷积层应该不能进行剪枝吧,因为在深度卷积中,卷积核个数必须要与输入特征图的通道数一致。

欢迎交流!

bbilixzc avatar Apr 02 '22 01:04 bbilixzc

你的问题我曾经好像也遇到过,这应该是环境问题,百度的环境一直会有些bug,建议把pip的安装方式和在paddledetection中的setup两种ppdet安装方式都试一下,或者只能重装环境

我的问题的话,那么是不是对于将DW层完全封装好的脚本模型,就没有办法对特征提取主干网络mobilenet的DW层进行分析剪枝了,只能对其他的卷积层进行剪枝,这样的话剪枝效果感觉不太行

------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleSlim" @.>; 发送时间: 2022年4月2日(星期六) 上午9:35 @.>; @.>;"State @.>; 主题: Re: [PaddlePaddle/PaddleSlim] 小白的剪枝问题 (Issue #1018)

感谢回复!

但是我使用2.1版本的Paddle Detection去跑敏感度分析的脚本,还是有报错这个错误:ImportError: cannot import name 'create_reader' from 'ppdet.data.reader';不知道您是否有遇到过?

对于dw层不能进行分析:我的看法是depth wise卷积层应该不能进行剪枝吧,因为在深度卷积中,卷积核个数必须要与输入特征图的通道数一致。

欢迎交流!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

TANSHOUTAO avatar Apr 02 '22 01:04 TANSHOUTAO

在做静态图的敏感度分析时,用的static中的config吗 @TANSHOUTAO ,我做的有问题麻烦您看下https://github.com/PaddlePaddle/PaddleDetection/issues/6453#issue-1306564809

SunYF-0729 avatar Jul 18 '22 20:07 SunYF-0729