According to the original paper of SPP-net, I think the kernel_size and stride for each pooling should be set as follows:

level = 2 ** i
kernel_size = (math.ceil(h / level), math.ceil(w / level))
stride = (math.floor(h/ level), math.floor(w / level))