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

This commit is contained in:
Glenn Jocher 2024-05-22 13:09:39 +02:00 committed by GitHub
parent f065931e8e
commit 5298d57308
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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