Warn on mutually exclusive `half=True` and `int8=True` (#13020)

pull/13006/head
Glenn Jocher 6 months ago committed by GitHub
parent f065931e8e
commit 5298d57308
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      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

Loading…
Cancel
Save