When I try to run Chapter 6 on Colab: Google Colab
For the following line of code:
loss_func = nn.BCEWithLogitsLoss()
loss = loss_func(activs, y)
loss
I get the following error:
TypeError Traceback (most recent call last)
<ipython-input-27-38b1530800fe> in <cell line: 2>()
1 loss_func = nn.BCEWithLogitsLoss()
----> 2 loss = loss_func(activs, y)
3 loss
4 frames
/usr/local/lib/python3.10/dist-packages/torch/overrides.py in handle_torch_function(public_api, relevant_args, *args, **kwargs)
1657 if _is_torch_function_mode_enabled():
1658 msg += f" nor in mode {_get_current_function_mode()}"
-> 1659 raise TypeError(msg)
1660
1661 has_torch_function = _add_docstr(
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'>]