New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Add separable_conv2d_transpose operation #12001
Comments
Hi, I will try to work on this one. @andreas-eberle do you have specific examples in which a seperable_conv2d_transpose operation is profitable? Do you have a link to your e.g.? |
Please provide the links of the reference papers |
Sorry, didn't notice that I forgot the link. In The Devil is in the Decoder they compare several "deconvolution" strategies and show that separable transposed convolution has very good performance. In section 2.1.1 they give a short explanation about separable transposed convolution. Afaik, separable (not transposed) convolution was introduced in Xception: Deep Learning with Depthwise Separable Convolutions |
+1 on that. |
Hi, is anyone working on this anymore? |
useful feature to be implemented |
any updates on this ? |
I'd like to try a GAN with separable_conv2d and separable_conv2d_transpose, and i was surprised to see that separable_conv2d_transpose isn't available yet. Some have stated they started working on an implementation, how is that work going? |
I would also be able to help with an implementation, @tjingrant have you started on it? |
Any idea when there will be an implementation for separable_conv2d_transpose? |
Any update to this feature? |
Easiest to just use |
@chris-boson. This is not equivalent. One of the major selling points of DepthwiseConv2DTranspose (if it existed) is a reduction of parameters, which would not be achieved by a transpose followed by a depthwise conv. |
@HouseOfFinwe It does in fact reduce the parameter count considerably, especially in the case of many output channels. Use filters of shape |
+1 on this, would be highly appreciated. |
@chris-boson could you give a clearer example of using Conv2DTranspose followed by DepthwiseConv2D? Regardless, I still think a pure depthwise transpose would be even more efficient |
Any update to this feature? |
Any updates or progress on this? |
I would be interested in this |
That would be a nice addition indeed. |
Seems like a feature that makes a lot of sense |
Would this require a new op? Is it difficult because of lack of hw support? |
Any update on this? |
1 similar comment
Any update on this? |
Would like to see this feature implemented |
+1 |
Hi, is anyone working on this currently? |
Is it very different to using upsampling + separableconv ? |
@edmondja the problem with upsampling + separableconv is that it increases the number of computations compared to sep-conv2d-transpose |
Anyone find a workaround? I attempted to do a workaround with a stack of Conv2DTranspose, each with filters=1... but it was not very efficient. No promise this works but this was my attempt fwiw. class DepthwiseConv2DTranspose(layers.Layer):
|
Any update? |
Here are two sample ones that do some of it, the first doesn't compile on TPU it does work on CPU
The second compiles also on TPU and works well on CPU but doesn't train on TPU
If any solutions found do update thanks! |
any update ? |
@Orpheus23 is your TF Depthwise Conv2dTranspose implementation in #12001 (comment) still the best available today? |
Idk about any recent changes, but until early 2021(When I was checking) it was. If a better solution is needed, then it is best to write the same in c++ and export it. The layers that I had written didn't train properly on TPU(Idk about GPU, if it worked for someone then do update) as they required a lot of space in memory. Perhaps it is because of the mapping of conv2d transpose to every layer and the space required by tf.transpose + tf.squeeze. Either way it would best to define on c++, the functions that tensorflow provides on python are very unideal for defining a new type of layer. With c++ there could be a better alternative to mapping conv2d_transpose to every layer and then reshaping everything. |
@Orpheus23 hmm, yes that's what I was worried about. We've been running YOLOv5 experiments with these layers in PyTorch, and they seem to export well everywhere except TF. We build the TF models natively rather than go through ONNX, and currently there seems to be no efficient solution to build TF models with these layers. In PyTorch it's pretty simple as you can just set groups to equal the input/output channel counts to create depthwise conv2dtranspose layers. |
That's there, Pytorch works very well in these matters. The group feature is not here, maybe with tf.gather and conv2d transpose you might be able to do it, it will not be very clean. If you really want to go ahead with TF here, then C++ is the best bet. Integrating the C++ part with python was not that much of a headache. Otherwise the other alternatives are, to do bi-linear interpolation and then depth-wise conv2d or to hack it out with TF in python. In any case, Best of luck with the implementation. |
@Orpheus23 got it, thanks! I'm linking @zldrobit here, who's been a lot of the brains behind the YOLOv5 TF models. |
@AyushExel @sergiossm this is the main issue I found regarding DW Conv2d Transpose layers in TF (C++ conversion proposed by @Orpheus23) |
Hey guys, any update on this feature? |
Any update on the feature request for depthwise conv2d transpose? |
This issue is stale because it has been open for 180 days with no activity. It will be closed if no further activity occurs. Thank you. |
Some recent papers (e.g.) have shown that transposed separable convolutions can be a great choice for decoders in encoder decoder architectures.
Can you add a seperable_conv2d_transpose operation comparable to the conv2d_transpose operation?
The text was updated successfully, but these errors were encountered: