diff --git a/ultralytics/models/sam/sam3/decoder.py b/ultralytics/models/sam/sam3/decoder.py index 32cb43d7..a1e1ad8a 100644 --- a/ultralytics/models/sam/sam3/decoder.py +++ b/ultralytics/models/sam/sam3/decoder.py @@ -330,7 +330,7 @@ class TransformerDecoder(nn.Module): # cache miss, will create compilation issue # In case we're not compiling, we'll still rely on the dict-based cache if feat_size not in self.coord_cache: - self.coord_cache[feat_size] = self._get_coords(H, W, reference_boxes.device) + self.coord_cache[feat_size] = self._get_coords(H, W, reference_boxes.device, reference_boxes.dtype) coords_h, coords_w = self.coord_cache[feat_size] assert coords_h.shape == (H,)