Zardinality / TF-deformable-conv

Implementation of deformable convolution as an operation in tensorflow
Apache License 2.0
111 stars 30 forks source link

Did you find that it failed when you use padding="VALID"? #9

Open Zealoe opened 6 years ago

Zealoe commented 6 years ago

I met a problem that when i set padding="VALID", the loss function did not converge. However, it converged when i set padding="SAME"...other config is same. And i also dumped the offset. it was clipped by 0?? (I didn't use tf.clip at all) image

Zardinality commented 6 years ago

What dilation_rate did you use? I am guessing maybe because I use partial version of GetWindowedOutputSize. You can change all function call of GetWindowedOutputSize in deform_conv.cc like in here to GetWindowedOutputSizeV2 and rebuild. Also, a dirty workaround would be slice your input to make its spatial dimension divisible by param.

Zealoe commented 6 years ago

the input feature map is 24*24, and the offset conv setting is image

the deformable conv setting is image

Zealoe commented 6 years ago

sorry to disturb, but when i change GetWindowedOutputSize in deform_conv.cc and rebuild, it failed when i run g++_complie.sh. So what should i do to make it work? Thanks! image

Zardinality commented 6 years ago

I am also baffled why it failed to build, GetWindowedOutputSize and GetWindowedOutputSizeV2 are defined in the same file, and your arguments seem all right. In fact, I was wondering, now that your spatial dimension is exactly divided by filter size, shouldn't VALID and SAME behave just the same?

Zealoe commented 6 years ago

What version of tensorflow do you use? I am using 1.1.0 and GetWindowedOutputSizeV2 is not defined in common_shape_fns.h .. if i copy the file common_shape_fns.h including GetWindowedOutputSizeV2 to my tensorflow, the deformable conv can be built, but when i use it, it shows image

Zardinality commented 6 years ago

@Zealoe GetWindowedOutputSizeV2 is introduced in this commit, so I guess it should be 1.3 or 1.4 at least. Good luck with it.