onnx / keras-onnx

Convert tf.keras/Keras models to ONNX
Apache License 2.0
379 stars 109 forks source link

fused batchnorm result in conv #710

Open pilz22 opened 3 years ago

pilz22 commented 3 years ago

hello, here I first tried to convert my keras model to onnx format. when I check the nodes in graph,it seems all conv2d and batchnorm are merged in to one node, the optype is 'conv'. and then i have to convert the onnx model to other model type. I want to consult whether and how the merged conv keeps the functions of batchnorm? if it is only a conv, then the batchnorm layer is missed when converted to other model type?

jiafatom commented 3 years ago

We use ConvBatchNormOptimizer in onnxconverter-common to fuse conv+batchnorm, see the line here