You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Chapter 6 notebook: 06_multicat.ipynb,
The binary cross entropy calculation using either the nn module or F function gives "TypeError"
Executing this cell,
loss_func = nn.BCEWithLogitsLoss()
loss = loss_func(activs, y)
loss
Gives, TypeError: no implementation found for 'torch.nn.functional.binary_cross_entropy_with_logits' on types that implement __torch_function__: [<class 'fastai.torch_core.TensorImage'>, <class 'fastai.torch_core.TensorMultiCategory'>]
Furthermore, trying to calculate the same loss using function seems to run into the same problem too.
loss = F.binary_cross_entropy_with_logits(activs, y)
loss
TypeError: no implementation found for 'torch.nn.functional.binary_cross_entropy_with_logits' on types that implement __torch_function__: [<class 'fastai.torch_core.TensorImage'>, <class 'fastai.torch_core.TensorMultiCategory'>]
The issue persisted in both CPU and GPU runtime.
The text was updated successfully, but these errors were encountered:
The issue says that the F.binary_cross_entropy_with_logits does not work on TensorImage and also it will not work on TensorMask. So, you need to change those to torch tensors to make them work. You can wrap them with TensorBase() and you are good to go.
In the Chapter 6 notebook: 06_multicat.ipynb,
The binary cross entropy calculation using either the nn module or F function gives "TypeError"
Executing this cell,
Gives,
TypeError: no implementation found for 'torch.nn.functional.binary_cross_entropy_with_logits' on types that implement __torch_function__: [<class 'fastai.torch_core.TensorImage'>, <class 'fastai.torch_core.TensorMultiCategory'>]
Furthermore, trying to calculate the same loss using function seems to run into the same problem too.
TypeError: no implementation found for 'torch.nn.functional.binary_cross_entropy_with_logits' on types that implement __torch_function__: [<class 'fastai.torch_core.TensorImage'>, <class 'fastai.torch_core.TensorMultiCategory'>]
The issue persisted in both CPU and GPU runtime.
The text was updated successfully, but these errors were encountered: