Enforce `dynamic=True` for TensorRT and OpenVINO INT8 (#11788)

pull/11801/head^2
Burhan 7 months ago committed by GitHub
parent fcfc44ea9c
commit 2940110974
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/engine/exporter.py

@ -200,7 +200,7 @@ class Exporter:
self.args.half = False
assert not self.args.dynamic, "half=True not compatible with dynamic=True, i.e. use only one."
self.imgsz = check_imgsz(self.args.imgsz, stride=model.stride, min_dim=2) # check image size
if self.args.int8 and engine:
if self.args.int8 and (engine or xml):
self.args.dynamic = True # enforce dynamic to export TensorRT INT8; ensures ONNX is dynamic
if self.args.optimize:
assert not ncnn, "optimize=True not compatible with format='ncnn', i.e. use optimize=False"

Loading…
Cancel
Save