Torch-Pruning
Torch-Pruning copied to clipboard
Why are the layers in ignored_layers still pruned?
Here is my code and the results of running it.
The layers printed out by ignored_layers are Detcet's layers, but it is still pruned. Here's the number of channels after pruning.
How can I change so that it doesn't prune the Detect layer?
Hi @AFallDay, in v1.3 we only ignore the output
of a layer and its input dim will be pruned due to its dependency to previous layers. If you need a more fine-grained ignore_list, please refer to the v1.4 branch, which supports ignored_layer_outputs
and ignored_layer_inputs
.
An example of ignored_layer_inputs
can be found here
Hi @AFallDay, in v1.3 we only ignore the
output
of a layer and its input dim will be pruned due to its dependency to previous layers. If you need a more fine-grained ignore_list, please refer to the v1.4 branch, which supportsignored_layer_outputs
andignored_layer_inputs
.An example of
ignored_layer_inputs
can be found here
thanks @VainF ,I've looked at the example in v1.4 but there are input and output channels that need to be defined, and they seem to be a little complicated to modify, do you have an easier way to modify it?
Yes, we can manually add the preceding layers to the ignored_layers.
Yes, we can manually add the preceding layers to the ignored_layers.
How do I add yolov5s‘layers to the ignored_layers? I'm not very good at it. Could you please answer?
You can manually find the coupled layers for the convs
in Detect and just append them into the ignored_layers
. I think v1.4 is easier to use. Just adding the line ignroed_layer_inputs=[ detect[0], detect[1], detect[2], detect[3] ]
should work.