Closed PkuRainBow closed 6 years ago
Hi @PkuRainBow, Indeed, as explained in the doc string, the function expects a Variable prediction and a Tensor ground truth. This makes sense as you cannot backpropagate on the ground truth. Note that Pytorch 0.4 alleviate the distinction between Tensor and Variables, so this distinction should disappear in the future.
I have solved this problem!
I test the pytorch implementation on my project and I call the lovasz_loss like below:
But I got such errors:
Then I checked the implementations for lovasz_softmax_flat function:
So it seems that we do not need to convert the fg with Variable(fg).