From 5298d57308f51ca9450b37afbf197f9e8c335334 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 22 May 2024 13:09:39 +0200 Subject: [PATCH] Warn on mutually exclusive `half=True` and `int8=True` (#13020) --- ultralytics/engine/exporter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index 7e1baa46..4b66d585 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -195,6 +195,9 @@ class Exporter: if not hasattr(model, "names"): model.names = default_class_names() model.names = check_class_names(model.names) + if self.args.half and self.args.int8: + LOGGER.warning("WARNING ⚠️ half=True and int8=True are mutually exclusive, setting half=False.") + self.args.half = False if self.args.half and onnx and self.device.type == "cpu": LOGGER.warning("WARNING ⚠️ half=True only compatible with GPU export, i.e. use device=0") self.args.half = False