Transforming a Model - 2.0 English

Vitis AI Optimizer User Guide (UG1333)

Document ID
UG1333
Release Date
2022-01-20
Version
2.0 English

After a few iterations of pruning, you get a model that is much smaller than its original size. 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
Note: The transformation is only required after all iterations of pruning have been completed and you do not need to run the transform command after each iteration of pruning.

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

./vai_p_darknet pruner stat model-transform.cfg

The command outputs the following.

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