Closed pedrofrodenas closed 7 months ago
Hey, thanks for bringing this up! I fixed what I could in v0.12.2
, but there are still problems with TFJS. It only works when groups == 1
or groups == in_channels
. As a last resort, you can always express grouped convolution as normal one, missing out on efficiency. In fact, that's how ConvTranspose1d
/ConvTranspose2d
are converted, Tensorflow just completely botched it: https://github.com/tensorflow/tensorflow/issues/45216.
When I define a define a model with DepthWise convolutions (groups == input_channels) the model is converted sucessfully but the tensorflow frozen_graph of this model cannot be converted to tensorflow.js. The problem is that
keras.layers.Conv2D
generates a PartitionedCall in the frozen_graph that cannot be converted to tensorflow.js.I provide the python code to reproduce the problem:
Inspecting the ExampleModel.pb with Netron this is what happens:
In order to fix this error, I made a custom nn.Conv2d converter:
But I think that probably is better to fix this in the source code.