2022 IEEE GRSS Data Fusion Contest Track SLM Forum

Go back to competition Back to thread list Post in this thread

> baseline's loss is always nan

```py
class FocalDiceLoss(nn.Module):
def __init__(
self, mode: str = "multiclass", ignore_index: int = 0, normalized: bool = False
):
super().__init__()
self.focal_loss = smp.losses.FocalLoss(
mode=mode, ignore_index=ignore_index, normalized=normalized
)
self.dice_loss = smp.losses.DiceLoss(mode=mode, ignore_index=ignore_index)

def forward(self, preds, targets):
print(preds) # None
print(self.focal_loss(preds, targets))
print(self.dice_loss(preds, targets))
return self.focal_loss(preds, targets) + self.dice_loss(preds, targets)
```

Posted by: lanling @ Jan. 17, 2022, 2:08 p.m.

No, it's not. For questions about the baseline, please contact the developers of the baseline.

Posted by: rhaensch @ Jan. 17, 2022, 3:33 p.m.

OK

Posted by: lanling @ Jan. 17, 2022, 3:37 p.m.
Post in this thread