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
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