Skip to content

Commit

Permalink
[Fix] Fix bug, gt_label and feats are not at the same device
Browse files Browse the repository at this point in the history
  • Loading branch information
thaiph99 committed Aug 26, 2023
1 parent 7fa2eb9 commit 3232732
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmtrack/models/reid/linear_reid_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def loss_by_feat(self, feats: torch.Tensor,
if feats.is_cuda:
# push gt_label to cuda
cuda_idx = feats.get_device()
gt_label = gt_label.to(device=f"cuda:{cuda_idx}")
gt_label = gt_label.to(device=f'cuda:{cuda_idx}')

if self.loss_triplet:
losses['triplet_loss'] = self.loss_triplet(feats, gt_label)
Expand Down

0 comments on commit 3232732

Please sign in to comment.