From 3232732e5f48700702449b188ba67fab95f46ede Mon Sep 17 00:00:00 2001 From: thaiph99 Date: Sat, 26 Aug 2023 11:21:49 +0700 Subject: [PATCH] [Fix] Fix bug, gt_label and feats are not at the same device --- mmtrack/models/reid/linear_reid_head.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtrack/models/reid/linear_reid_head.py b/mmtrack/models/reid/linear_reid_head.py index 5dd80a7af..9af076c03 100644 --- a/mmtrack/models/reid/linear_reid_head.py +++ b/mmtrack/models/reid/linear_reid_head.py @@ -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)