rethinking-network-pruning icon indicating copy to clipboard operation
rethinking-network-pruning copied to clipboard

Pruning steps

Open Afef00 opened this issue 5 years ago • 3 comments

If I want to prune VGG model using l1 norm pruning method and CIFAR dataset I have to run: 1- main.py 2-Vggprune.py 3-main_finetune.py Because when i start with Vggprune.py I obtained a test accuracy with 10% of the model and the same test acuuracy of the newmodel (pruned model).

Also, I don't undestand this line: out_channels = m.weight.data.shape[0] And why the choice of : start_mask = torch.ones(3) , is it because the in_channels are 3 ??

Afef00 avatar Dec 28 '19 09:12 Afef00

I don't quite understand the first question. Are you asking why the test accuracy of pruned model is small? Maybe the model is pruned too much.

out_channels is just the number of filters in the convolutional layer with kernel weight m. start_mask=torch.ones(3) is just to initialize the mask with the first convolution layer that has 3 input channels.

Eric-mingjie avatar Dec 28 '19 17:12 Eric-mingjie

For the first question, I meant that if I try to run your code to prune VGG model using l1 norm pruning method and CIFAR dataset I should at first run main.py to obtain the accuracy of the model before pruning then I run Vggprune.py for the pruning and lastly to retrain the pruned model I run main_finetune.py.

Afef00 avatar Jan 02 '20 21:01 Afef00

I should at first run main.py to obtain the accuracy of the model before pruning then I run Vggprune.py for the pruning and lastly to retrain the pruned model I run main_finetune.py.

That is correct.

Eric-mingjie avatar Jan 03 '20 01:01 Eric-mingjie