You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If all instances in a single batch have the same class, the NTXentLoss crashes with an uninformative warning:
AttributeError: 'list' object has no attribute 'dtype'
This is because this line assigns an empty list to neg_pairs if there are no negative pairs.
This crash can be avoided by moving the check for dtype in NTXentLoss (i.e., this line) a bit down, so it is enclosed by the if statement.
Should be a rare occurrence anyway, but I'd thought I'd signal it nonetheless 🐱
I can do a PR if you'd like, but maybe this is such a small fix that it doesn't need a separate PR
The text was updated successfully, but these errors were encountered:
If all instances in a single batch have the same class, the
NTXentLoss
crashes with an uninformative warning:This is because this line assigns an empty list to
neg_pairs
if there are no negative pairs.This crash can be avoided by moving the check for dtype in
NTXentLoss
(i.e., this line) a bit down, so it is enclosed by the if statement.Should be a rare occurrence anyway, but I'd thought I'd signal it nonetheless 🐱
I can do a PR if you'd like, but maybe this is such a small fix that it doesn't need a separate PR
The text was updated successfully, but these errors were encountered: