- 
                Notifications
    You must be signed in to change notification settings 
- Fork 101
Description
When optimizing and running some VGG and ResNet DUC HDC models from ONNX Model Hub, I encountered an issue related to BatchNormalization nodes. In particular:
For VGG-16-BN, and VGG-19-BN (opset=7)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Non-zero status code returned while running BatchNormalization node. Name:'vgg0_batchnorm0_fwd' Status Message: Invalid input scale: NumDimensions() != 3
For ResNet101_DUC_HDC (opset=7)
2025-03-18 18:55:58.724319765 [E:onnxruntime:, sequential_executor.cc:514 ExecuteKernel] Non-zero status code returned while running BatchNormalization node. Name:'conv1_1_3x3_s2/bn' Status Message: Invalid input scale: NumDimensions() != 3 [ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Non-zero status code returned while running BatchNormalization node. Name:'conv1_1_3x3_s2/bn' Status Message: Invalid input scale: NumDimensions() != 3
This error was happening on all passes in the optimizer, so it is not associated to one particular pass. Also, the models work normally for greater opset (e.g., opset=12), but opset=7 is part of the official ONNX Hub and the current ONNX version is backwards compatible to it.