Solved by ptrblck in post #2 
              
              
                This error would be raised, if you pass an empty tensor to the pooling layer as shown here: 
pool = nn.MaxPool2d(2)
x = torch.randn(1, 3, 24, 24)
out = pool(x) # works

y = torch.tensor([[[[]]]])
out = pool(y)
> RuntimeError: non-empty 3D or 4D input tensor expected but got ndim: 4

Could you check …