Skip to content
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

Deformable Convolutional Op Support #179

Closed
rootkitchao opened this issue Apr 16, 2019 · 21 comments
Closed

Deformable Convolutional Op Support #179

rootkitchao opened this issue Apr 16, 2019 · 21 comments

Comments

@rootkitchao
Copy link

System information

  • TensorFlow version (you are using):2.0 alpha
  • TensorFlow Addons version:0,21
  • Is it in the tf.contrib (if so, where):no
  • Are you willing to contribute it (yes/no):yes,if i know how to do that
  • Are you willing to maintain it going forward? (yes/no):yes

Describe the feature and the current behavior/state.
Deformable Convolutional Network(https://arxiv.org/pdf/1703.06211.pdf,https://arxiv.org/pdf/1703.06211.pdf) has achieved good results in the du detection task.But the current version of Tensorflow does not seem to implement deformable convolution operations.The efficiency of some third-party implementations of deformable convolution operations is lower than that of the mxnet version(https://github.com/msracver/Deformable-ConvNets).I hope that Tensorflow can add native deformable convolution operations in future versions.
Thanks.
Will this change the current api? How?
Yes,Add a new op
Who will benefit with this feature?
Any one want to use tensorflow for object detection.
Any Other info.

@seanpmorgan seanpmorgan changed the title [Feature Request]Deformable Convolutional Op Suppor [Feature Request] Deformable Convolutional Op Support Apr 16, 2019
@Squadrick
Copy link
Member

Here's a python only implementation of v1 for Keras which can be ported to TF-Keras. This repository is the official implementation with CUDA code; it's written using MXNet but it can be ported over to TensorFlow.

Here are the papers:

  1. Deformable Convolutional Networks
  2. Deformable ConvNets v2

I can start working on this if needed. I'll get the python implementation for v2 up and running first, followed by the proper CUDA/C++ implementation.

@rootkitchao
Copy link
Author

Here's a python only implementation of v1 for Keras which can be ported to TF-Keras. This repository is the official implementation with CUDA code; it's written using MXNet but it can be ported over to TensorFlow.
Here are the papers:

Deformable Convolutional Networks
Deformable ConvNets v2

I can start working on this if needed. I'll get the python implementation for v2 up and running first, followed by the proper CUDA/C++ implementation.

Thanks for reply.And here is a Mask RCNN implemented by Tensorflow that may help test.

@facaiy
Copy link
Member

facaiy commented May 16, 2019

@rootkitchao Welcome, William. I think you can go first because you seems willing to contribute the codes, right?

Are you willing to contribute it (yes/no):yes,if i know how to do that

Sorry for the delay, and thank @Squadrick for the reference paper and implementation :-)

@Squadrick
Copy link
Member

@rootkitchao Any update? I can work on this if you aren't.

@Squadrick
Copy link
Member

Using native CUDA for deform conv is dependant on #118 .

@seanpmorgan seanpmorgan added the help wanted Needs help as a contribution label Sep 6, 2019
@jlhervy
Copy link

jlhervy commented Nov 20, 2019

I tried to look into it, but it is too hard for me to do as I don't have experience in CUDA.

I wonder how hard would it be to port this implementation (tf1.4) to tf2.0 :
https://github.com/Zardinality/TF-deformable-conv

This is the first version of the paper, but ideally it would be nice to have deformable-conv V2 :
https://arxiv.org/abs/1811.11168
For which there is an implementation for pytorch, as cited by @Squadrick

Thank you

@vlordier
Copy link

vlordier commented Dec 3, 2019

@Squadrick you mentioned you'd implement DCN v2 in TF 2 : is this something you're having progress with ?

@Squadrick
Copy link
Member

@vlordier Nope, haven't found the time to get around to this. Feel free to open a PR if you decide to work on this.

@seanpmorgan seanpmorgan changed the title [Feature Request] Deformable Convolutional Op Support Deformable Convolutional Op Support Dec 27, 2019
@bhack
Copy link
Contributor

bhack commented Feb 5, 2020

/cc @smallsunsun1

@smallsunsun1
Copy link

/cc @smallsunsun1

I implemented a Deformable Conv2D V2 And DeformablePsROIAlign operation In both cpu and gpu according to mmdetection https://github.com/open-mmlab/mmdetection. My implenmentation is https://github.com/smallsunsun1/custom_ops/tree/master/deformable_conv2d_ops_new , which support tf2.0 and built by CMake.

@bhack
Copy link
Contributor

bhack commented Feb 6, 2020

@smallsunsun1 Do you want to officially PR your impl on TF addons?

@smallsunsun1
Copy link

@bhack Maybe I can have a try, but I haven't PR before, it may task some time==

@seanpmorgan
Copy link
Member

@bhack Maybe I can have a try, but I haven't PR before, it may task some time==

Please let us know if there is anyway we can help. We have some documentation to get you started.

TFA pull requests: https://github.com/tensorflow/addons/blob/master/CONTRIBUTING.md#pull-requests
Getting started with contributions: https://github.com/gabrieldemarmiesse/getting_started_open_source

@smallsunsun1
Copy link

@seanpmorgan I clone the addons repo, tested my deformable_conv2d impl in local, building passed in tensorflow2.0 and cuda10.0, noticed the lastest branch is target in tensorflow2.1 and cuda10.1. But I can't have a cuda10.1 environment to test the code. Is there any problem if I push a request

@seanpmorgan
Copy link
Member

@seanpmorgan I clone the addons repo, tested my deformable_conv2d impl in local, building passed in tensorflow2.0 and cuda10.0, noticed the lastest branch is target in tensorflow2.1 and cuda10.1. But I can't have a cuda10.1 environment to test the code. Is there any problem if I push a request

Not at all. We have CI testing that will run it on GPU for you (So even if you didn't have a GPU you could still test it.) We welcome WIP PRs so feel free to start the PR and we can go from there.

@smallsunsun1
Copy link

already open a PR #1129, support DeformableConv2d ,DeformablepsROIalign and EquiConv

@alexattia
Copy link

Do you have any news about the progress of this PR and deformable convolutions in TensorFlow?

@Licht-T
Copy link

Licht-T commented Oct 30, 2020

I've created new PR since the previous PR is stale and contains the unknown license code. I'd like to make my PR reviewed before it gets stale ;-).
#2196

@seyed-mohammadreza-mousavi

Hello. I hope you are good. There is no implementation of deformable convolution in tensorflow2. Could someone please help me?
There is a deform conv class where you can use it in tensorflow2 but you can not use it in tensorflow model?
How can I make this class to be usable in models?

@Cospel
Copy link

Cospel commented Jun 20, 2022

@aAmohammadrezaaA The state of deformable convolution in tensorflow 2 is tearful. There were several different merge requests with different implementations. I tried in the past some of them and all were quite good and working. However both tensorflow team and tf-addons team have little time to do good PR and integration it to the framework. The best advice right now is to try different framework if you want to have a good support of deformable convolutions.

@seanpmorgan
Copy link
Member

TensorFlow Addons is transitioning to a minimal maintenance and release mode. New features will not be added to this repository. For more information, please see our public messaging on this decision:
TensorFlow Addons Wind Down

Please consider sending feature requests / contributions to other repositories in the TF community with a similar charters to TFA:
Keras
Keras-CV
Keras-NLP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.