Edge TPU export 'list index out of range' fix (#6533)
Browse files
export.py
CHANGED
@@ -315,10 +315,10 @@ def export_tflite(keras_model, im, file, int8, data, ncalib, prefix=colorstr('Te
|
|
315 |
def export_edgetpu(keras_model, im, file, prefix=colorstr('Edge TPU:')):
|
316 |
# YOLOv5 Edge TPU export https://coral.ai/docs/edgetpu/models-intro/
|
317 |
try:
|
318 |
-
cmd = 'edgetpu_compiler --version
|
319 |
help_url = 'https://coral.ai/docs/edgetpu/compiler/'
|
320 |
assert platform.system() == 'Linux', f'export only supported on Linux. See {help_url}'
|
321 |
-
if subprocess.run(cmd, shell=True).returncode != 0:
|
322 |
LOGGER.info(f'\n{prefix} export requires Edge TPU compiler. Attempting install from {help_url}')
|
323 |
sudo = subprocess.run('sudo --version >/dev/null', shell=True).returncode == 0 # sudo installed on system
|
324 |
for c in ['curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -',
|
|
|
315 |
def export_edgetpu(keras_model, im, file, prefix=colorstr('Edge TPU:')):
|
316 |
# YOLOv5 Edge TPU export https://coral.ai/docs/edgetpu/models-intro/
|
317 |
try:
|
318 |
+
cmd = 'edgetpu_compiler --version'
|
319 |
help_url = 'https://coral.ai/docs/edgetpu/compiler/'
|
320 |
assert platform.system() == 'Linux', f'export only supported on Linux. See {help_url}'
|
321 |
+
if subprocess.run(cmd + ' >/dev/null', shell=True).returncode != 0:
|
322 |
LOGGER.info(f'\n{prefix} export requires Edge TPU compiler. Attempting install from {help_url}')
|
323 |
sudo = subprocess.run('sudo --version >/dev/null', shell=True).returncode == 0 # sudo installed on system
|
324 |
for c in ['curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -',
|