akcaymert:

loss_dice = dice_loss(labels,output)


Hi,
It is not about data types you are using, I think it’s just a  typo. Somewhere else in your code you are using dice_loss but it is no longer referring to Dice_Loss class.
Error says dice_loss should be an instance of Dice_Loss is a int.
It is pretty simple to find errors like this, just run your code in debug mode and add dice_loss to watch and check its type after  dice_loss = Dice_Loss.apply or Dice_Loss()
Bests