-
Notifications
You must be signed in to change notification settings - Fork 800
Distiller Summary Reports
You can use the sample compression application to generate model various summary reports.
Summaries can be generated for all supported models, whether they are dense or sparse.
The following examples use a dense ResNet18 model to demonstrate some of the summary reports.
This feature is loosely inspired by Keras's print_summary.
-
Show feature-maps sizes and compute per layer
-
Show sparsity of each layer's weights tensors
-
Generate a PNG image of the network graph
-
Export to ONNX
- List all of the modules in the model
This assumes direct convolution and uses MAC as a compute metric (Multiply Accumulate operations). Only convolution and linear (fully-connected) layers are counted.
$ python3 compress_classifier.py -a=resnet18 ../../../data.imagenet --summary=compute
$ python3 compress_classifier.py -a=resnet18 ../../../data.imagenet --summary=sparsity
python3 compress_classifier.py -a=resnet18 ../../../data.imagenet --summary=png
You can also show the parameters:
python3 compress_classifier.py -a=resnet18 ../../../data.imagenet --summary=png_w_params
python3 compress_classifier.py -a=resnet18 ../../../data.imagenet --summary=onnx
python3 compress_classifier.py -a=resnet18 ../../../data.imagenet --summary=modules