{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22208","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22208/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22208/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22208/events","html_url":"https://github.com/tensorflow/tensorflow/issues/22208","id":358936128,"node_id":"MDU6SXNzdWUzNTg5MzYxMjg=","number":22208,"title":"LookupError: No gradient defined for operation type: ResizeNearestNeighborGrad or ResizeBilinearGrad","user":{"login":"GPrathap","id":7587302,"node_id":"MDQ6VXNlcjc1ODczMDI=","avatar_url":"https://avatars0.githubusercontent.com/u/7587302?v=4","gravatar_id":"","url":"https://api.github.com/users/GPrathap","html_url":"https://github.com/GPrathap","followers_url":"https://api.github.com/users/GPrathap/followers","following_url":"https://api.github.com/users/GPrathap/following{/other_user}","gists_url":"https://api.github.com/users/GPrathap/gists{/gist_id}","starred_url":"https://api.github.com/users/GPrathap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GPrathap/subscriptions","organizations_url":"https://api.github.com/users/GPrathap/orgs","repos_url":"https://api.github.com/users/GPrathap/repos","events_url":"https://api.github.com/users/GPrathap/events{/privacy}","received_events_url":"https://api.github.com/users/GPrathap/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bignamehyp","id":3474655,"node_id":"MDQ6VXNlcjM0NzQ2NTU=","avatar_url":"https://avatars2.githubusercontent.com/u/3474655?v=4","gravatar_id":"","url":"https://api.github.com/users/bignamehyp","html_url":"https://github.com/bignamehyp","followers_url":"https://api.github.com/users/bignamehyp/followers","following_url":"https://api.github.com/users/bignamehyp/following{/other_user}","gists_url":"https://api.github.com/users/bignamehyp/gists{/gist_id}","starred_url":"https://api.github.com/users/bignamehyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bignamehyp/subscriptions","organizations_url":"https://api.github.com/users/bignamehyp/orgs","repos_url":"https://api.github.com/users/bignamehyp/repos","events_url":"https://api.github.com/users/bignamehyp/events{/privacy}","received_events_url":"https://api.github.com/users/bignamehyp/received_events","type":"User","site_admin":false},"assignees":[{"login":"bignamehyp","id":3474655,"node_id":"MDQ6VXNlcjM0NzQ2NTU=","avatar_url":"https://avatars2.githubusercontent.com/u/3474655?v=4","gravatar_id":"","url":"https://api.github.com/users/bignamehyp","html_url":"https://github.com/bignamehyp","followers_url":"https://api.github.com/users/bignamehyp/followers","following_url":"https://api.github.com/users/bignamehyp/following{/other_user}","gists_url":"https://api.github.com/users/bignamehyp/gists{/gist_id}","starred_url":"https://api.github.com/users/bignamehyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bignamehyp/subscriptions","organizations_url":"https://api.github.com/users/bignamehyp/orgs","repos_url":"https://api.github.com/users/bignamehyp/repos","events_url":"https://api.github.com/users/bignamehyp/events{/privacy}","received_events_url":"https://api.github.com/users/bignamehyp/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-09-11T08:15:48Z","updated_at":"2018-09-15T18:06:48Z","closed_at":null,"author_association":"NONE","body":"### System information:\r\n- **OS Platform and Distribution**: Linux Ubuntu 16.04\r\n- **TensorFlow installed from (source or binary)**:binary\r\n- **TensorFlow version**:1.10.0\r\n- **Python version**:2.7.x\r\n- **CUDA/cuDNN version**:9.0.x\r\n- **Have I written custom code (as opposed to using a stock example script provided in TensorFlow)**:Nope\r\n- **Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device**:N/\r\n- **Bazel version (if compiling from source)**: N/A\r\n- **GCC/Compiler version (if compiling from source)**:N/A\r\n- **GPU model and memory**: Geforce 940mx\r\n- **Exact command to reproduce**: N/A\r\n\r\n### Describe the problem\r\nI want to the gradient of any of [these image resizing operations](https://www.tensorflow.org/api_docs/python/tf/image/ResizeMethod) inside the neural network. But seems to be any of these does not define the gradient ops for them. I see there is a [similar issue ](https://github.com/tensorflow/tensorflow/issues/7641) which has not been answered yet. I also asked in the [SO](https://stackoverflow.com/questions/52264891/lookuperror-no-gradient-defined-for-operation-type-resizenearestneighborgrad) but still, I did not get an answer for this. \r\n\r\n### Source code / logs\r\n\r\n      \r\n\t\tdifferences = tf.subtract(images_fake, images_real)\r\n\t\talpha_shape = [params.batch_size] + [1] * (differences.shape.ndims - 1)\r\n\t\talpha = tf.random_uniform(shape=alpha_shape, minval=0., maxval=1.)\r\n\t\tinterpolates = images_real + (alpha * differences)\r\n\t\td_model = Model(params, args.mode, interpolates, reuse_variables, images_fake, 1)\r\n\t\tgradients = tf.gradients(d_model.logistic_linear, [interpolates])[0]\r\n\t\tslopes = tf.sqrt(tf.reduce_sum(tf.square(gradients), reduction_indices=[1]))\r\n\t\tgradient_penalty = tf.reduce_mean((slopes - 1.) ** 2)\r\n\t\t_gradient_penalty = 10 * gradient_penalty\r\n\r\nInside my model, it uses [ tf.image.resize_bicubic()](https://www.tensorflow.org/api_docs/python/tf/image/resize_bicubic). But I see there are some [exisiting implementation](https://github.com/tensorflow/tensorflow/commit/3331c574bcfd85787d7a4f3d1b1b139239a6595b) for this. But not sure how those things get it them working. Please let me know how this can be achieved. These image resizing cannot be done as preprocessing it needs to be done inside a model. Any help would be really appreciated. "},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/421609230","html_url":"https://github.com/tensorflow/tensorflow/issues/22208#issuecomment-421609230","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/22208","id":421609230,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTYwOTIzMA==","user":{"login":"GPrathap","id":7587302,"node_id":"MDQ6VXNlcjc1ODczMDI=","avatar_url":"https://avatars0.githubusercontent.com/u/7587302?v=4","gravatar_id":"","url":"https://api.github.com/users/GPrathap","html_url":"https://github.com/GPrathap","followers_url":"https://api.github.com/users/GPrathap/followers","following_url":"https://api.github.com/users/GPrathap/following{/other_user}","gists_url":"https://api.github.com/users/GPrathap/gists{/gist_id}","starred_url":"https://api.github.com/users/GPrathap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GPrathap/subscriptions","organizations_url":"https://api.github.com/users/GPrathap/orgs","repos_url":"https://api.github.com/users/GPrathap/repos","events_url":"https://api.github.com/users/GPrathap/events{/privacy}","received_events_url":"https://api.github.com/users/GPrathap/received_events","type":"User","site_admin":false},"created_at":"2018-09-15T18:06:48Z","updated_at":"2018-09-15T18:06:48Z","author_association":"NONE","body":"yeap, I will try and let you know. Thanks "}}
{"actor":{"display_login":"GPrathap"}}