No gradient defined for operation MaxPoolWithArgmax in tensorflow
<p>I wanna use <code>max_pool_with_argmax</code> operation in TensorFlow, but I got following error:</p>

<blockquote>
  <p>LookupError: No gradient defined for operation 'MaxPoolWithArgmax_1' (op type: MaxPoolWithArgmax)</p>
</blockquote>

<p>Here is a piece of my code that I am using <code>max_pool_with_argmax</code>:</p>

<pre><code>BN_relu13 =   tf.nn.relu(tf.nn.batch_normalization(h_conv13,batch_mean13,batch_var13,tf.Variable(tf.zeros([64])),tf.Variable(tf.ones([64])),epsilon)) 
#max pooling 
h_pool1, argmax_1 = max_pool_2x2(BN_relu13)
</code></pre>

<p>and here is <code>max_pool_2x2</code> module:</p>

<pre><code>def max_pool_2x2(x):
    return tf.nn.max_pool_with_argmax(x, ksize=[1, 2, 2, 1],strides=[1, 2, 2, 1], padding='SAME')
</code></pre>

<p>and after I built my network I am using <code>AdamOptimizer</code> to train my network. </p>

<p>By the way, when I am using <code>tf.nn.max_pool</code> (instead of <code>tf.nn.max_pool_with_argmax</code>) everything is working fine. </p>

<p>I am running my code on GPU and I am using python 2.7 on ubuntu14.</p>

<p>Thanks, Ali </p>