I’m using a loss function available in PyTorch, however I get the following warning. I’m not sure what I would need to change to ensure they have the same size. I can’t find any reference of this error happening in fastai that proposes a solution to this.
/home/bob/anaconda3/envs/fastai/lib/python3.7/site-packages/fastai/basic_train.py:30: UserWarning: Using a target size (torch.Size()) that is different to the input size (torch.Size([32, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
loss = loss_func(out, *yb)
huber_loss = partial(F.smooth_l1_loss)
learn = cnn_learner(data, models.resnet152, loss_func=huber_loss)