Skip to content

Commit a542c55

Browse files
authored
Fix lovasz loss (#461)
1 parent ec80704 commit a542c55

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

segmentation_models_pytorch/losses/lovasz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def _flatten_probas(probas, labels, ignore=None):
148148
probas = probas.view(B, 1, H, W)
149149

150150
C = probas.size(1)
151-
probas = torch.movedim(probas, 0, -1) # [B, C, Di, Dj, Dk...] -> [B, C, Di...Dk, C]
151+
probas = torch.movedim(probas, 1, -1) # [B, C, Di, Dj, ...] -> [B, Di, Dj, ..., C]
152152
probas = probas.contiguous().view(-1, C) # [P, C]
153153

154154
labels = labels.view(-1)

0 commit comments

Comments
 (0)