pocketpose.utils.stats.tflite
#
Module Contents#
Functions#
|
Estimates the number of floating point operations in a TFLite model. |
|
Estimates the number of parameters in a TFLite model. |
|
- pocketpose.utils.stats.tflite.estimate_flops_tflite(model_path: str) float #
Estimates the number of floating point operations in a TFLite model.
Note: This is a rough estimate which only considers CONV_2D, DEPTHWISE_CONV_2D, FULLY_CONNECTED, ADD, and MUL operators.
For FULLY_CONNECTED layer, we assume that the number of FLOPs is approximately 2 times the number of elements in the weight matrix, which assumes that each weight participates in one multiplication and one addition.
For ADD and MUL layers, we assume that each operation is performed element-wise, and so the number of FLOPs is equal to the total number of elements in the input tensor.
- Args:
model_path (str): Path to TFLite model
- Returns:
float: Number of estimated GFLOPs in the model