arjun-majumdar / Neural_Network_Pruning

Implementations of different neural network pruning techniques
MIT License
13 stars 0 forks source link

about structure pruning #3

Open Christian-lyc opened 2 days ago

Christian-lyc commented 2 days ago

Hi, Thank you for your code. I used pytorch structure pruning for global pruning. I could find 0 in weight_mask, before prune.remove(module, 'weight') My code is like this: for name, module in model.model.named_modules(): if isinstance(module, nn.Conv2d): if 0 in module.weight_mask: print(module.weight) prune.remove(module, 'weight')

print(module.weight) can show 0 weights, but after prune.remove, it still shows that the weight as original. Do you know what problem is there? Thank you so much

Christian-lyc commented 2 days ago

Sorry, I checked again, after remove function, the pruned part still shows 0, which should be removed.