tensorflow-onnx
tensorflow-onnx copied to clipboard
Batch normalization layer from Keras only converts to BatchNormalization op if dims >= 4
Hi Onnx team, I'm running into a model conversion issue for Kera's BatchNorm layer. The BatchNorm layer is only converted into a BatchNorm Op in Onnx when input Dim>=4. I believe this stems from the fact that the tf-onnx converter will only convert as a BatchNorm Op if the original TF Op is a FusedBatchNorm operator. Currently, my work around is to expand_dim the input so that the BatchNorm Op is inserted by the converter, otherwise it just becomes a single Mul op. This is problematic for training.
With 4D input:
With 3D input:
Is that possible to share a code snippet for a repro?