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

suitable prune rule #3

Closed
PiseyYou opened this issue Jul 29, 2019 · 3 comments
Closed

suitable prune rule #3

PiseyYou opened this issue Jul 29, 2019 · 3 comments

Comments

@PiseyYou
Copy link

PiseyYou commented Jul 29, 2019

When training, there are something different between your code and @Lam1360 code, such as:

in Lam1360 code, the training is:
1, python train.py --model_def config/yolov3-hand.cfg -sr --s 0.01

but in yours, missing the back value.

2,for step2, in Lam1360 code, he didn't show the suitable prune rule, but in your code, it is

python test_prune.py

no suitable prune rule following.

I was wonder whether you have already test and the result is fine, or you missing some key point.

@PiseyYou
Copy link
Author

if the auther has already test the result, can you upload the result, and there are more information can discuss which can lead to the results we want.

@PiseyYou
Copy link
Author

PiseyYou commented Jul 29, 2019

in @talebolano code, the prune rule is:

python prune.py --cfg yolov3.cfg --weights checkpoints/yolov3_sparsity_100.weights --percent 0.3

the --percent 0.3 is following, I wonder whether this it the suitable value, or more test result.

@violet17
Copy link
Owner

It is the same...... This parameter is " --s 0.01" is the default parameter in the code.

The prune rule is (1)避免剪掉所有channel的最高阈值(每个BN层的gamma的最大值的最小值即为阈值上限)
(2)剪枝的时候会先对 bias 做处理,用其后的卷积层或者 BN 层来吸收这个参数,然后再将权重赋值给 compact model,
这样做的话就能保证 pruned_model (只对 weight 置 0 的模型)和 Compact_model 对相同的输入有相同的输出

The prune ratio mainly depend on the application.

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