Reduce EdgeTPU to 3 compiler steps (#16880)

Signed-off-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
pull/16643/head
Glenn Jocher 1 month ago committed by GitHub
parent 54d8801dfb
commit 1c4d788aa1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      ultralytics/engine/exporter.py

@ -960,7 +960,15 @@ class Exporter:
LOGGER.info(f"\n{prefix} starting export with Edge TPU compiler {ver}...")
f = str(tflite_model).replace(".tflite", "_edgetpu.tflite") # Edge TPU model
cmd = f'edgetpu_compiler -s -d -k 10 --out_dir "{Path(f).parent}" "{tflite_model}"'
cmd = (
"edgetpu_compiler "
f'--out_dir "{Path(f).parent}" '
"--show_operations "
"--search_delegate "
"--delegate_search_step 3 "
"--timeout_sec 180 "
f'"{tflite_model}"'
)
LOGGER.info(f"{prefix} running '{cmd}'")
subprocess.run(cmd, shell=True)
self._add_tflite_metadata(f)

Loading…
Cancel
Save