jcreinhold / tiramisu-brulee

A 2D and 3D PyTorch implementation of the Tiramisu CNN
Other
5 stars 2 forks source link

Dice metric in almost_isbi15_score outputs zero every iteration #6

Closed ptohidi closed 3 years ago

ptohidi commented 3 years ago

🐛 Bug

I was training the model on lesion segmentation data (using the cli tools), and wrote "print(dice)" after line 52 of tiramisu_brulee.experiments.lesion_tools (which is "dice = dice_score(pred.int(), target.int())") and the code printed 0 at every iteration.

To fix this, I used the "dice_loss" function from "tiramisu_brulee.loss" instead of the dice function supplied by torchmetrics, and it seems to works as expected.

To Reproduce

Steps to reproduce the behavior:

  1. Add print(dice) statement
  2. Run code
  3. ???
  4. Profit

Additional context

I encountered this issue when I was training a 3D tiramisu network for supervised binary lesion segmentation using 4 input channels (T1, T2, FLAIR, PD).

jcreinhold commented 3 years ago

Thanks for the report. I'll look into this.

jcreinhold commented 3 years ago

Fixed with da3377ac6865cdea3873a8924b8f6b8705a594c9. Re-install the package and verify that you're using version 0.1.19. Re-open the issue if the problem persists. Thanks for the report!