Hi @ptrblck, I changed the padding to 1 in conv3 but I am still getting the same error :
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py in nll_loss(input, target, weight, size_average, ignore_index, reduce)
1049         return torch._C._nn.nll_loss(input, target, weight, size_average, ignore_index, reduce)
1050     elif dim == 4:
-> 1051         return torch._C._nn.nll_loss2d(input, target, weight, size_average, ignore_index, reduce)
1052     else:
1053         raise ValueError(‘Expected 2 or 4 dimensions (got {})’.format(dim))
RuntimeError: invalid argument 3: only batches of spatial targets supported (3D tensors) but got targets of dimension: 1 at /pytorch/torch/lib/THNN/generic/SpatialClassNLLCriterion.c:60