DeformableGenerator
DeformableGenerator copied to clipboard
Problem with clipping in warping function
Hi,
I tried running your code on Python 3.7.1 with tensorflow==1.14.0. But the code runs into error. The error is in the clipping done in _interpolate() function in custom_ops.py.
Error seems to be in the following lines:
x = tf.clip_by_value(x, zero1 + 0.000001, max_x1 - 0.000001)
x0 = tf.cast(tf.floor(x), 'int32')
x1 = x0 + 1
The value 0.000001 seems to be too small for clipping to max_x1 and hence the maximum value of x1 turns out to be equal to max_x1 +1 which is equal to the image height and is not a valid index for an image height dimension.
The error is solved by changing the first line that I have mentioned above to:
x = tf.clip_by_value(x, zero1 + 0.000001, max_x1 - 0.00001)