Closed 95hali74 closed 2 years ago
I had a look at this and believed the performance would be affected too much to make it worthwhile and instead opted for removing group convolution from the model. I did the conversion using the 'Openvino2Tensorflow' method, which splits group convolutions in this way.
It might need one of those warnings like when a transpose is injected, to show we are doing a suboptimal change to the model in order to maintain compatibility. See: https://github.com/AxisCommunications/onnx-to-keras/blob/53bce898d3dbc660473bc58f225fb4194b7be095/onnx2keras.py#L42
Good idea.
I added an OptimizationMissingWarning warning and also made the splitting optional using the arg make_tflite_compatible
Currently the tests fails because of a keras version mismatch, se this PR: https://github.com/AxisCommunications/onnx-to-keras/pull/36
See: https://github.com/tensorflow/tensorflow/issues/4004
This PR changes the Conv2D layer creation: group = n_channels -> Depthwise Conv2D group = 1 -> Regular Conv2D else -> Split into group number of Conv2D layers
Is it fine if this is the default behavior or maybe a command line arg (for example "make_tflite_compatible_model") for changing the behavior is prefererad?