Model Transformation - 1.1 English

AI Optimizer User Guide (UG1333)

Document ID
UG1333
Release Date
2020-07-07
Version
1.1 English

After a few iterations of pruning, you’ll get a model that is much smaller than its original size. Finally, you need to transform the pruned model, which has many zero channels, to a normal model.

Run the following command to transform model.

./vai_p_darknet pruner transform pruning/cfg backup/*_final.weights

It should be noted that transformation is only required after all iterations of pruning have been completed and you do not need to run transform command between each iteration of pruning.

If you want to know the compression ratio or how many operations are in the pruned network, using the “stat” command.

./vai_p_darknet pruner stat model-transform.cfg

The command outputs as follows.

...
layer 104, ops:1595576320
layer 104, params:295168
layer 105, ops:104036400
layer 105, params:19275
Total operations: 41495485135
Total params: 43693647