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[2] * shape[3])) output_list.append(argmax % (shape[2] * shape[3]) // shape[3]) return tf.pack(output_list)
Here is an example of using ipython on a laptop (I use it to send the argmax pool positions to my subcooling method)
source share