Skip to content

Commit

Permalink
🧹 Correct output_names for coreml exports
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonhollands committed Feb 23, 2025
1 parent 3bfa804 commit 114beef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yolo/utils/export_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ def __init__(self, cfg: Config, model: YOLO, format: str, model_path: Optional[s
"9_bbox_deltas_large",
]

self.output_names: List[str] = ["preds_cls", "preds_anc", "preds_box"]

def export_onnx(self, dynamic_axes: Optional[Dict[str, Dict[int, str]]] = None, model_path: Optional[str] = None):
logger.info(f":package: Exporting model to onnx format")
import torch
Expand Down Expand Up @@ -93,6 +91,8 @@ def export_coreml(self):
# Convert to Core ML program using the Unified Conversion API.
logging.getLogger("coremltools").disabled = True

self.output_names: List[str] = ["preds_cls", "preds_anc", "preds_box"]

model_from_export = ct.convert(
exported_program, outputs=[ct.TensorType(name=name) for name in self.output_names], convert_to="mlprogram"
)
Expand Down

0 comments on commit 114beef

Please sign in to comment.