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'
Anirudh Badrinath commented
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.
It'd be great if you could share more details (pip version, python version).