I meet a problem: After I use the tf.nn.max_pool_with_argmax, I obtain the indices i.e.
argmax: A Tensor of type Targmax. 4-D. The flattened indices of the max values chosen for each output.
I had the same problem today and I ended up with this solution:
def unravel_argmax(argmax, shape): output_list =  output_list.append(argmax // (shape * shape)) output_list.append(argmax % (shape * shape) // shape) return tf.pack(output_list)
Here is a usage example in a ipython notebook (I use it to forward the pooling argmax positions to my unpooling method)