Extract BatchNorm mean and variance from TFLite model

I have a TFLite model that contains a FusedBatchNorm operation that seems to be fused with a Conv2d operation. I am trying to reproduce the output of that operation, however, I am not able to do that without knowing the fused_batch_norm parameters (mean and variance) for that particular operation/tensor. Is there a way to extract the FusedBatchNorm or BatchNorm parameters (mean and variance) from the TFLite model?

Thanks

Hi @siweb ,

You can either visualize the model using netron to see all the parameters or load the TFLite model using the TensorFlow Lite Python interpreter and manually inspect the tensors associated with the FusedBatchNorm operation.

Thank You .

No you cannot. Neither way reveal the mean/variance values. Either these values are merged into the fused op bias/scale or they are hardcoded in the op!

Can some one from the TF dev team give some insights on how the conv+batch_norm op is fused. The only source code I found for TFlite conv (tensorflow/tensorflow/lite/kernels/internal/reference/conv.h at master · tensorflow/tensorflow · GitHub) has no mention of batch_norm.