Reduce EdgeTPU to 3 compiler steps (#16880)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
54d8801dfb
commit
1c4d788aa1
1 changed files with 9 additions and 1 deletions
|
|
@ -960,7 +960,15 @@ class Exporter:
|
||||||
LOGGER.info(f"\n{prefix} starting export with Edge TPU compiler {ver}...")
|
LOGGER.info(f"\n{prefix} starting export with Edge TPU compiler {ver}...")
|
||||||
f = str(tflite_model).replace(".tflite", "_edgetpu.tflite") # Edge TPU model
|
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}'")
|
LOGGER.info(f"{prefix} running '{cmd}'")
|
||||||
subprocess.run(cmd, shell=True)
|
subprocess.run(cmd, shell=True)
|
||||||
self._add_tflite_metadata(f)
|
self._add_tflite_metadata(f)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue