Skip to content

'DiceCELoss' object is not callable #1526

@PouriaRouzrokh

Description

@PouriaRouzrokh

Hello.
It seems that there is a bug in calling a DiceCELoss object in the training loop.
The following code will fail with this error: "TypeError: 'DiceCELoss' object is not callable"

loss_function = monai.losses.DiceCELoss() # before the training
# ....
loss = loss_function(outputs, labels) # in the training loop

I have installed MONAI from git and the same code works if I simply call DiceLoss instead of DiceCELoss.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions