It seems you have a typo in your code and are reusing the targets tensor in the actual loss calculation while the DataLoader loop returns inputs (used) and labels (unused), so I guess you might need to replace targets with labels.
1 Like