Solved by fmassa in post #2 
              
              
                As explained in the docs for MaxUnpool, the when doing MaxPooling, there might be some pixels that get rounded up due to integer division on the input size. For example, if your image has size 5, and your stride is 2, the output size can be either 2 or 3, and you can’t retrieve the original size of …