From 887558705babce54dabd2fe06ab0123395b38b69 Mon Sep 17 00:00:00 2001 From: J-Doc <695362+ijdoc@users.noreply.github.com> Date: Sat, 1 Apr 2023 21:29:28 -0400 Subject: [PATCH] Fix https://github.com/WongKinYiu/yolov7/issues/1101#issuecomment-1314659118 --- utils/loss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/loss.py b/utils/loss.py index bf7ab65a30..6eb70a2fa7 100644 --- a/utils/loss.py +++ b/utils/loss.py @@ -739,7 +739,7 @@ def build_targets(self, p, targets, imgs): + 3.0 * pair_wise_iou_loss ) - matching_matrix = torch.zeros_like(cost) + matching_matrix = torch.zeros_like(cost, device="cpu") for gt_idx in range(num_gt): _, pos_idx = torch.topk(