Another findings, it only happens when I implement the data augmentation. Please find the loss value below,
If I remove the data augmentation part, I can run the code with no error.
loss values: dict_values([tensor(1.0371, device='cuda:0', grad_fn=<NllLossBackward>), tensor(0.2726, device='cuda:0', grad_fn=<DivBackward0>), tensor(0.0177, device='cuda:0', grad_fn=<BinaryCrossEntropyWithLogitsBackward>), tensor(0.0003, device='cuda:0', grad_fn=<DivBackward0>)])