John-Yao / focal_loss_pytorch

2 stars 0 forks source link

Questions! #1

Open Youngkl0726 opened 6 years ago

Youngkl0726 commented 6 years ago

logpt = F.log_softmax(input) # NHW,C UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument.

John-Yao commented 6 years ago

It is caused by difference of the version of pytorch . My pytorch version: 0.2.0_4 You can specific the param "dim" according to your version Moreover, here is a more simply version of FocalLoss:( https://github.com/ZijunDeng/pytorch-semantic-segmentation/blob/master/utils/misc.py)