diff --git a/pyproject.toml b/pyproject.toml index 00d2e3c2bab..778a266ee2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ docs = [ xpu = [ "torch==2.6.0.dev20241104+xpu", "torchvision==0.20.0.dev20241104+xpu", - "pytorch-triton-xpu==3.1.0+91b14bf559" + "pytorch-triton-xpu==3.1.0+91b14bf559", "oneccl_bind_pt==2.1.300+xpu", "lightning==2.2", "pytorchcv==0.0.67", diff --git a/src/otx/algo/keypoint_detection/heads/rtmcc_head.py b/src/otx/algo/keypoint_detection/heads/rtmcc_head.py index d6f0f7cd0d5..267c703f259 100644 --- a/src/otx/algo/keypoint_detection/heads/rtmcc_head.py +++ b/src/otx/algo/keypoint_detection/heads/rtmcc_head.py @@ -192,7 +192,7 @@ def loss(self, x: tuple[Tensor], entity: KeypointDetBatchDataEntity) -> dict: mask=mask, ) - loss_pose = -1 * torch.tensor(avg_acc, device=device) + loss_pose = -1 * torch.tensor(avg_acc, device=device, dtype=torch.float32) losses.update(loss_pose=loss_pose) return losses diff --git a/src/otx/core/metrics/mlc_map.py b/src/otx/core/metrics/mlc_map.py index 940056d7532..6cb4ecd1524 100644 --- a/src/otx/core/metrics/mlc_map.py +++ b/src/otx/core/metrics/mlc_map.py @@ -49,8 +49,7 @@ def update(self, preds: Tensor, target: Tensor) -> None: def compute(self) -> Tensor | dict[str, Any]: """Compute the metric.""" - metric_value = _map(torch.stack(self.targets).cpu().numpy(), torch.stack(self.preds).cpu().numpy()) - + metric_value = _map(torch.stack(self.targets).cpu().numpy(), torch.stack(self.preds).detach().cpu().float().numpy()) return {"mAP": Tensor([metric_value])}