Hi, @ptrblck
I used the model deeplabv3_resnet101 and met the same error. I checked that the output is indeed a dict object.
Could you tell me how to use the output in the criterion?
Here is my code in which inputs is a tesor of NxCxHxW and  labels is Nx1xHxW
criterion = nn.CrossEntropyLoss(ignore_index=0)
outputs = model(inputs)
loss = criterion(outputs, labels)

I tried to use
loss = criterion(outputs["out"], labels).
But there is a RuntimeError: invalid argument 3: only batches of spatial targets supported (3D tensors) but got targets of dimension: 4 at …\aten\src\THNN/generic/SpatialClassNLLCriterion.c:59
Another question is that my dataset(images) have 5 classes and some ignoer pixels then should I set the num_classes to 5 or 6 in the model ?
Thank you!