Check for lrpc attribute before attempting fuse during YOLOE model export (#24239)

Signed-off-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Mohammed Yasin 2026-04-16 08:08:34 +06:00 committed by GitHub
parent 1bd9712f6c
commit 5dc005dfaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -476,7 +476,7 @@ class Exporter:
m.agnostic_nms = self.args.agnostic_nms
m.xyxy = self.args.nms and fmt != "coreml"
m.shape = None # reset cached shape for new export input size
if hasattr(model, "pe") and hasattr(m, "fuse"): # for YOLOE models
if hasattr(model, "pe") and hasattr(m, "fuse") and not hasattr(m, "lrpc"): # for YOLOE models
m.fuse(model.pe.to(self.device))
elif isinstance(m, C2f) and not is_tf_format:
# EdgeTPU does not support FlexSplitV while split provides cleaner ONNX graph