Repository navigation
added image patch grad - #3672
Conversation
|
Can one of the admins verify this patch? |
|
|
||
|
|
||
| @ops.RegisterGradient("ExtractImagePatches") | ||
| def _ExtractImagePatchesGrad(op, grad): |
There was a problem hiding this comment.
Thanks for the contribution, this looks pretty good. Can you add a regression test to make sure the code is correct? You can use https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/kernel_tests/conv2d_backprop_filter_grad_test.py#L25 as an example.
|
added the tests, let me know if there's anything else |
|
@tensorflow-jenkins test this please |
|
Jenkins, test this please. |
|
The tests are failing :( |
|
I'm looking at the logs, and the one that's failing is //tensorflow/tools/test:check_futures_test. Should we let the other two tests finish, and then I'll push the fix? or should I push it now? |
|
Push the fix, and I'll re-trigger the tests. |
|
@tensorflow-jenkins test this please |
|
@benoitsteiner Can you LGTM this now that tests were added? |
| pad_rows = ((rows_out - 1) * stride_r + ksize_r_eff - rows_in) // 2 | ||
| pad_cols = ((cols_out - 1) * stride_h + ksize_c_eff - cols_in) // 2 | ||
|
|
||
| elif padding == 'VALID': |
There was a problem hiding this comment.
Looks like in python 3 PIP setups, there is a problem caused by these lines.
It looks like "padding" can be something other than 'SAME' or 'VALID'
any ideas what might be happening?
|
Looks like the BUILD file change for the test is missing from this PR. |
|
I am preparing a fix for the issue. |
|
The current gradient seems to have a problem when batch_size = array_ops.shape(op.inputs[0])[0]after this batch_size, rows_in, cols_in, channels = [
dim.value for dim in op.inputs[0].get_shape()
]and it seems to have fixed the problem. I am new to TensorFlow, so you probably have a better solution than this. |
This solves: #2921
I ran unit tests using tensorflow.python.ops.gradient_checker to verify that it works :D