Edge TPU export 'list index out of range' fix (#6533)
This commit is contained in:
1 parent
8d05716b66
commit
9bc72a3ac2
1 file changed
+2
-2
@@ -315,10 +315,10 @@ def export_tflite(keras_model, im, file, int8, data, ncalib, prefix=colorstr('Te
|
|||||||
def export_edgetpu(keras_model, im, file, prefix=colorstr('Edge TPU:')):
|
def export_edgetpu(keras_model, im, file, prefix=colorstr('Edge TPU:')):
|
||||||
# YOLOv5 Edge TPU export https://coral.ai/docs/edgetpu/models-intro/
|
# YOLOv5 Edge TPU export https://coral.ai/docs/edgetpu/models-intro/
|
||||||
try:
|
try:
|
||||||
cmd = 'edgetpu_compiler --version >/dev/null'
|
cmd = 'edgetpu_compiler --version'
|
||||||
help_url = 'https://coral.ai/docs/edgetpu/compiler/'
|
help_url = 'https://coral.ai/docs/edgetpu/compiler/'
|
||||||
assert platform.system() == 'Linux', f'export only supported on Linux. See {help_url}'
|
assert platform.system() == 'Linux', f'export only supported on Linux. See {help_url}'
|
||||||
if subprocess.run(cmd, shell=True).returncode != 0:
|
if subprocess.run(cmd + ' >/dev/null', shell=True).returncode != 0:
|
||||||
LOGGER.info(f'\n{prefix} export requires Edge TPU compiler. Attempting install from {help_url}')
|
LOGGER.info(f'\n{prefix} export requires Edge TPU compiler. Attempting install from {help_url}')
|
||||||
sudo = subprocess.run('sudo --version >/dev/null', shell=True).returncode == 0 # sudo installed on system
|
sudo = subprocess.run('sudo --version >/dev/null', shell=True).returncode == 0 # sudo installed on system
|
||||||
for c in ['curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -',
|
for c in ['curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -',
|
||||||
|
|||||||
Reference in new issue
Block a user