Weight parameter of DiceLoss #7606
Replies: 2 comments 2 replies
-
Hi @NastaranVB, please check the type of |
Beta Was this translation helpful? Give feedback.
2 replies
-
Thank you very much. The version was the reason. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have used loss function as below:
lloss_function=DiceLoss(include_background=False, to_onehot_y=True, softmax=True, reduction='mean', smooth_nr=0, smooth_dr=1e-5, weight=[2, 10])
In past days it was working but now I get the below error:
TypeError Traceback (most recent call last)
/tmp/ipykernel_1144963/2523664510.py in
11 model=unet,
12 learning_rate=1e-3,
---> 13 loss_function=DiceLoss(include_background=False, to_onehot_y=True, softmax=True, reduction='mean', smooth_nr=0, smooth_dr=1e-5, weight=[2, 10]),
14 optimizer_name=torch.optim.AdamW,
15 scheduler_name=torch.optim.lr_scheduler.ExponentialLR,
TypeError: init() got an unexpected keyword argument 'weight'
Beta Was this translation helpful? Give feedback.
All reactions