nn.MaxUnpool2d expects to get indices, which are created by e.g. nn.MaxPool2d.
As described before, neither nn.AdaptiveAvgPool2d nor nn.AvgPool2d return indices and setting return_indices=True in these layers will return a TypeError:
nn.AdaptiveAvgPool2d(2, return_indices=True)
> TypeError: __init__() got an unexpected keyword argument 'return_indices'
nn.AvgPool2d(2, return_indices=True)
> TypeError: __init__() got an unexpected keyword argument 'return_indices'