I figured out, where it is happening. When I print the “losses.values()” one of the loss values is torch.float64. But when I tried to change its dtype, its still throwing the same error.
@ptrblck could you please help me to sort this out?
tensor(1.0891, device='cuda:0', grad_fn=<NllLossBackward>)
torch.float32
tensor(0.0064, device='cuda:0', grad_fn=<DivBackward0>)
torch.float32
tensor(0.0779, device='cuda:0', grad_fn=<BinaryCrossEntropyWithLogitsBackward>)
torch.float64
tensor(0.0163, device='cuda:0', dtype=torch.float64, grad_fn=<DivBackward0>)
loss values: dict_values([tensor(1.0891, device='cuda:0', grad_fn=<NllLossBackward>), tensor(0.0064, device='cuda:0', grad_fn=<DivBackward0>), tensor(0.0779, device='cuda:0', grad_fn=<BinaryCrossEntropyWithLogitsBackward>), tensor(0.0163, device='cuda:0', dtype=torch.float64, grad_fn=<DivBackward0>)])