Forward() missing 2 required positional arguments: 'input' and 'target'

This also happened to me when I initialized the criterion. For example,

criterion = torch.nn.BCELoss()

I solve this problem by:

criterion = torch.nn.BCELoss

2 Likes