GithubHelp home page GithubHelp logo

Comments (6)

vshampor avatar vshampor commented on May 24, 2024 1

@mkaglins @vanyalzr

from nncf.

nsk-lab avatar nsk-lab commented on May 24, 2024

@vshampor @mkaglins @vanyalzr
I am testing NNCF tool for our development. Any suggestions would be greatly appreciated :)

from nncf.

vshampor avatar vshampor commented on May 24, 2024

@nsk-lab indeed, nn.ConvTranspose2d pruning is not supported. However, the models that simply contain nn.ConvTranspose2d and don't prune it should still be prunable with respect to the supported prunable ops (which are convolutions, at the moment), so this seems to be a bug.

Please try #171 and see if it fixes your issue.

from nncf.

lzrvch avatar lzrvch commented on May 24, 2024

Hi @nsk-lab, does your model have a significant amount of ConvTranspose2D layers?
If that's the case and you wish to prune them along with standard Conv2d layers, we could plan to add ConvTranspose2D to the scope of prunable ops in filter pruning.

from nncf.

vshampor avatar vshampor commented on May 24, 2024

@nsk-lab did applying #171 resolve your problem?

from nncf.

nsk-lab avatar nsk-lab commented on May 24, 2024

@vshampor @vanyalzr

Yes. I could export onnx without error. thx.

But the final pruning rate was low.
my setting:

    "params": {
        "schedule": "baseline", // The type of scheduling to use for adjusting the target pruning level. Either `exponential`, `exponential_with_bias`,  or `baseline`, by default it is `baseline`"
        "pruning_init": 0.1, // Initial value of the pruning level applied to the model. 0.0 by default.
        "pruning_target": 0.4, // Target value of the pruning level for the model. 0.5 by default.
        "num_init_steps": 1, // Number of epochs for model pretraining before starting filter pruning. 0 by default.
        "pruning_steps": 4, // Number of epochs during which the pruning rate is increased from `pruning_init` to `pruning_target` value.
        "weight_importance": "L2", // The type of filter importance metric. Can be one of `L1`, `L2`, `geometric_median`. `L2` by default.
        "all_weights": false, // Whether to prune layers independently (choose filters with the smallest importance in each layer separately) or not. `False` by default.
        "prune_first_conv": false, // Whether to prune first Convolutional layers or not. First means that it is a convolutional layer such that there is a path from model input to this layer such that there are no other convolution operations on it. `False` by default.
        "prune_last_conv": false, // Whether to prune last Convolutional layers or not.  Last means that it is a Convolutional layer such that there is a path from this layer to the model output such that there are no other convolution operations on it. `False` by default.
        "prune_downsample_convs": false, // Whether to prune downsample Convolutional layers (with stride > 1) or not. `False` by default.
        "prune_batch_norms": false, // Whether to nullifies parameters of Batch Norm layer corresponds to zeroed filters of convolution corresponding to this Batch Norm. `False` by default.
        "zero_grad": true // Whether to setting gradients corresponding to zeroed filters to zero during training, `True` by default.
    },```

and the log at 5 epoch is

.
. (ommited)
.

+--------+--------+--------+--------+--------+--------+--------+-------+-------+
| XXXXXX | [64,   | [40,   | [64]   | [40]   | 147520 | 92200  | 0.375 | 0.375 |
| XXXX/Y | 256,   | 256,   |        |        |        |        |       |       |
| YYYYYY | 3, 3]  | 3, 3]  |        |        |        |        |       |       |
| YYY[ZZ |        |        |        |        |        |        |       |       |
| Z]/NNC |        |        |        |        |        |        |       |       |
| FConv2 |        |        |        |        |        |        |       |       |
| d[0]   |        |        |        |        |        |        |       |       |
+--------+--------+--------+--------+--------+--------+--------+-------+-------+
| XXXXXX | [64,   | [40,   | [64]   | [40]   | 147520 | 92200  | 0.375 | 0.375 |
| XXXX/Y | 256,   | 256,   |        |        |        |        |       |       |
| YYYYYY | 3, 3]  | 3, 3]  |        |        |        |        |       |       |
| YYY[ZZ |        |        |        |        |        |        |       |       |
| ]/NNCF |        |        |        |        |        |        |       |       |
| Conv2d |        |        |        |        |        |        |       |       |
| [0]    |        |        |        |        |        |        |       |       |
+--------+--------+--------+--------+--------+--------+--------+-------+-------+
INFO:nncf:Final Model Pruning Rate = 0.165
INFO:nncf:Total MAC pruning level = 0.124

0.165 is much lower than pruning target 0.4
Is it due to uncompressed ConvTranspose2D layer?

if so, i really want the support of pruning ConvTranspose2D

from nncf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.