I am able to run the auto-cast by the loss is causing an issue, my code looks like:
with torch.cuda.amp.autocast():
          logits = classifier(images)
          loss = criterion(logits, labels)

And I am getting an error on loss calculation. The error mentions that I should use some other loss function other that BCELoss, but I need to have a sigmoid layer just before the output, so what kind of loss should I use as the pytorch is recommending me to use loss with logits.
Or is there some way to make it work.
The error message is:
image1442×319 22.5 KB