Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'DiceCELoss' object is not callable #1526

Closed
PouriaRouzrokh opened this issue Jan 29, 2021 · 1 comment · Fixed by #1527
Closed

'DiceCELoss' object is not callable #1526

PouriaRouzrokh opened this issue Jan 29, 2021 · 1 comment · Fixed by #1527

Comments

@PouriaRouzrokh
Copy link

PouriaRouzrokh commented Jan 29, 2021

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.

wyli added a commit to wyli/MONAI that referenced this issue Jan 29, 2021
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@wyli wyli mentioned this issue Jan 29, 2021
3 tasks
@wyli
Copy link
Contributor

wyli commented Jan 29, 2021

thanks for reporting this!

wyli added a commit that referenced this issue Jan 30, 2021
* fixes #1526

Signed-off-by: Wenqi Li <wenqil@nvidia.com>

* fixes Useless inheritance from object https://deepsource.io/gh/Project-MONAI/MONAI/issue/PYL-R0205

Signed-off-by: Wenqi Li <wenqil@nvidia.com>

* fixes https://github.com/Project-MONAI/MONAI/pull/1527/checks?check_run_id=1794062607#step:10:7763

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants