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

module 'segmentation_models.losses' has no attribute 'DiceLoss' #560

Open
Blissful-Jasper opened this issue Mar 31, 2023 · 1 comment
Open

Comments

@Blissful-Jasper
Copy link

The version I installed is 1.0.1, and I found an error when using its function:
dice_loss = sm.losses.DiceLoss(class_weights=weights)
focal_loss = sm.losses.CategoricalFocalLoss()

the erros is:module 'segmentation_models.losses' has no attribute 'DiceLoss'

@Baakchsu
Copy link

Baakchsu commented Sep 4, 2023

Hi @xpji! I tried to reproduce your issue by installing v1.0.1 (pip3 install segmentation_models==1.0.1) and importing sm.losses.DiceLoss(). However, I am able to execute without any errors.
image

It'd be great if you could share more details (pip version, python version).

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

No branches or pull requests

2 participants