Fix dynamic export with YOLO World (#19304)

Signed-off-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com>
pull/18455/head^2
Mohammed Yasin 3 weeks ago committed by GitHub
parent e16593336b
commit fdeb04e7bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/engine/exporter.py

@ -520,7 +520,7 @@ class Exporter:
if isinstance(self.model, SegmentationModel):
dynamic["output0"] = {0: "batch", 2: "anchors"} # shape(1, 116, 8400)
dynamic["output1"] = {0: "batch", 2: "mask_height", 3: "mask_width"} # shape(1,32,160,160)
elif isinstance(self.model, DetectionModel):
elif isinstance(self.model, (DetectionModel, WorldModel)):
dynamic["output0"] = {0: "batch", 2: "anchors"} # shape(1, 84, 8400)
if self.args.nms: # only batch size is dynamic with NMS
dynamic["output0"].pop(2)

Loading…
Cancel
Save