qubvel / segmentation_models

Segmentation models with pretrained backbones. Keras and TensorFlow Keras.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

xpji opened this issue · comments

commented

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'

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).