Hi all,
I have got a problem about the pooling function, the code were shown below:
input = Variable(torch.rand(1,1,64,64))
pool1 = nn.MaxPool2d(2, stride=2, padding=1, return_indices=True)
pool2 = nn.MaxPool2d(2, stride=2, return_indices=True)
unpool1= nn.MaxUnpool2d(2, stride=2)
unpool2= nn.MaxUnpool2d(2, stride=2, padding=1)

output1, indices1 = pool1(input)
output2, indices2 = pool2(output1)

output3 = unpool1(output2,indices2)
output4 = unpool2(output3, indices1)

An error I had got:
RuntimeError: found an invalid max index 1054 (output volumes are of size 32x32) at /data/users/soumith/builder/wheel/pytorch-src/torch/lib/THNN/generic/SpatialMaxUnpooling.c:42
How to solve this problem, I want to used the pooling function to get the ouput4 which with the same dimension as input.
Thanks a lot!