-
Notifications
You must be signed in to change notification settings - Fork 798
filter pruning error #86
Comments
Hi @cattpku, You probably missed issue #85, but I think that what you are seeing is this same bug. As issue #85 explains, some networks have complicated data-dependencies which means that we can't arbitrarily prune filters, but we have to group them so that they all follow the same pruning decision. I realize this is somewhat hard to follow w/o more details so I plan to write and post a loner explanation in a couple of days. Until then, you can create a PNG graph of your model and I can use it to illustrate to you the dependencies and how to express them. Another option: take a look at this example, specifically at I hope this helps for now, |
Thanks for your kind explanation, Neta. I will try the branch later. |
Hi Neta, |
@cattpku - any chance you can provide more information? For example, the model definition and your YAML schedule file can help me understand, and hopefully recreate what you are seeing. |
Hi Neta, `
` And the YAML schedule is version: 1
The error comes from I tried to manually modify 'module.conv' in 'thinning.py' by clearing the 'module.conv.weight', and then using 'append_module_directive' and 'append_param_directive' to assign the correct value, now my own experiment succeeded. |
Hi @cattpku |
Sure.
` Then before 'return thinning_recipe', I manually modify the 'module.conv' as following:
` |
Hi Neta,
I met a an error when doing filter pruning, after debugging, I found it might because Distiller does not support concatenate operation.
The related layers of my network:
(aspp): ASPP_module(
(aspp0): Sequential(
(0): Conv2d(116, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(aspp1): Sequential(
(0): Conv2d(116, 256, kernel_size=(3, 3), stride=(1, 1), padding=(6, 6), dilation=(6, 6), bias=False)
(1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(aspp2): Sequential(
(0): Conv2d(116, 256, kernel_size=(3, 3), stride=(1, 1), padding=(12, 12), dilation=(12, 12), bias=False)
(1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
(aspp3): Sequential(
(0): Conv2d(116, 256, kernel_size=(3, 3), stride=(1, 1), padding=(18, 18), dilation=(18, 18), bias=False)
(1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
(global_avg_pool): Sequential(
(0): AdaptiveAvgPool2d(output_size=(1, 1))
(1): Conv2d(116, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
)
(conv): Conv2d(1280, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
where input of layer 'conv' is concatenating outputs of aspp0. aspp1. aspp2, aspp3 and global_avg_pool (at dim = 1)
my configuration for pruning:
Then it is supposed that Distiller should prune the following layer 'conv' to be Conv2d(640, 256, kernel_size=(1, 1), stride=(1, 1), bias=False), but I got error ' Given groups=1, weight of size [256, 128, 1, 1], expected input[8, 640, 60, 80] to have 128 channels, but got 640 channels instead', which means Distiller does not recognise the concatenated inputs.
Please advise, thanks.
The text was updated successfully, but these errors were encountered: