I get this error: TypeError: no implementation found for 'torch.nn.functional.cross_entropy' on types that implement __torch_function__: [<class 'fastai.torch_core.TensorImage'>, <class 'fastai.torch_core.TensorMask'>]
I have read many different topics about this issue, but I still have not a clear understanding of it. I suppose the problem regards the F.cross_entropy() function. Has a solution been found to this problem?
Update:
I have found this useful implementation of the FocalLoss (plus DiceLoss and CombinedLoss), but it works only with unet_learner() and not with the generic Learner(). How could I adapt the code to the Learner()? I am also trying to change the __call__ method with forward().
The error says that the input to the cross entropy is fastai TensorImage and a TensorMask. To use torch cross entropy, I think you would need to convert the fastai TensorImage to a torch tensor, and the TensorMask to a torch Tensor.