Deep-Compression.Pytorch icon indicating copy to clipboard operation
Deep-Compression.Pytorch copied to clipboard

How can prune before training?

Open ghost opened this issue 4 years ago • 2 comments

How to prune the existing model before training? That means I don't need to training to keep weight zero. I can get good accuracy on testloader after pruning. Now, I am confused no matter which percentage, test on testloader only 10% accuracy. Where is the wrong?

ghost avatar Aug 26 '21 11:08 ghost

Can you elaborate on the issue?

kentaroy47 avatar Sep 20 '21 11:09 kentaroy47

I solve this problem. In this code, that weights=abs(torchweights) and return after abs weight. If not prune the existing model before training, use weights=torchweights.cpu().numpy() weights_abs=np.abs(torchweights.cpu().numpy()) instead of the first two code.

ghost avatar Oct 01 '21 08:10 ghost