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

DiceLoss is unknown object type #2000

Open
james-imi opened this issue May 22, 2024 · 2 comments
Open

DiceLoss is unknown object type #2000

james-imi opened this issue May 22, 2024 · 2 comments

Comments

@james-imi
Copy link

james-imi commented May 22, 2024

🐛 Describe the bug

Getting this error if loss is DiceLoss

    result = train(exp_name, params)
  File "/home/ubuntu/super-gradients/train_segm_opt.py", line 163, in train
    trainer.train(model=model, training_params=default_params, train_loader=train_dataloader, valid_loader=val_dataloader)
  File "/opt/conda/envs/nas/lib/python3.9/site-packages/super_gradients/training/sg_trainer/sg_trainer.py", line 1270, in train
    self.criterion = LossesFactory().get({self.training_params.loss: self.training_params.criterion_params})
  File "/opt/conda/envs/nas/lib/python3.9/site-packages/super_gradients/common/factories/base_factory.py", line 70, in get
    raise UnknownTypeException(_type, list(self.type_dict.keys()))
super_gradients.common.exceptions.factory_exceptions.UnknownTypeException: Unknown object type: DiceLoss in configuration. valid types are: ['MSE', 'mse', '_deprecated_objects', 'KDLogitsLoss', 'kd_loss', 'CrossEntropyLoss', 'cross_entropy', 'RSquaredLoss', 'r_squared_loss', 'ShelfNetOHEMLoss', 'shelfnet_ohem_loss', 'ShelfNetSemanticEncodingLoss', 'shelfnet_se_loss', 'YoloXDetectionLoss', 'yolox_loss', 'YoloXFastDetectionLoss', 'yolox_fast_loss', 'SSDLoss', 'ssd_loss', 'BCEDiceLoss', 'bce_dice_loss', 'DiceCEEdgeLoss', 'dice_ce_edge_loss', 'PPYoloELoss', 'ppyoloe_loss', 'DEKRLoss', 'dekr_loss', 'STDCLoss', 'stdc_loss', 'RescoringLoss', 'rescoring_loss', 'YoloNASPoseLoss']

Versions

latest

@BloodAxe
Copy link
Collaborator

It seems DiceLoss is missing register decorator for some reason. Thanks for reporting about that.
May I ask - are you using some colab notebook with this loss or something else? Trying to understand how did you came up with with loss.

@james-imi
Copy link
Author

just my own notebook. also, by looking at your code. the Losses does not have DiceLoss in there

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