Skip to content

Commit 3575f0a

Browse files
authored
Edge TPU compiler comment (ultralytics#6196)
* Edge TPU compiler comment * 7 to 8 fix
1 parent e375e30 commit 3575f0a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

export.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
TensorFlow.js | `tfjs` | yolov5s_web_model/
1818
1919
Usage:
20-
$ python path/to/export.py --weights yolov5s.pt --include torchscript onnx coreml openvino saved_model tflite tfjs
20+
$ python path/to/export.py --weights yolov5s.pt --include torchscript onnx openvino engine coreml tflite ...
2121
2222
Inference:
2323
$ python path/to/detect.py --weights yolov5s.pt # PyTorch
@@ -179,7 +179,7 @@ def export_engine(model, im, file, train, half, simplify, workspace=4, verbose=F
179179
export_onnx(model, im, file, 12, train, False, simplify) # opset 12
180180
model.model[-1].anchor_grid = grid
181181
else: # TensorRT >= 8
182-
check_version(trt.__version__, '7.0.0', hard=True) # require tensorrt>=8.0.0
182+
check_version(trt.__version__, '8.0.0', hard=True) # require tensorrt>=8.0.0
183183
export_onnx(model, im, file, 13, train, False, simplify) # opset 13
184184
onnx = file.with_suffix('.onnx')
185185
assert onnx.exists(), f'failed to export ONNX file: {onnx}'
@@ -308,7 +308,7 @@ def export_tflite(keras_model, im, file, int8, data, ncalib, prefix=colorstr('Te
308308
def export_edgetpu(keras_model, im, file, prefix=colorstr('Edge TPU:')):
309309
# YOLOv5 Edge TPU export https://coral.ai/docs/edgetpu/models-intro/
310310
try:
311-
cmd = 'edgetpu_compiler --version'
311+
cmd = 'edgetpu_compiler --version' # install https://coral.ai/docs/edgetpu/compiler/
312312
out = subprocess.run(cmd, shell=True, capture_output=True, check=True)
313313
ver = out.stdout.decode().split()[-1]
314314
LOGGER.info(f'\n{prefix} starting export with Edge TPU compiler {ver}...')

models/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ def wrap_frozen_graph(gd, inputs, outputs):
376376
elif tflite: # https://www.tensorflow.org/lite/guide/python#install_tensorflow_lite_for_python
377377
if 'edgetpu' in w.lower(): # Edge TPU
378378
LOGGER.info(f'Loading {w} for TensorFlow Lite Edge TPU inference...')
379-
import tflite_runtime.interpreter as tfli
380-
delegate = {'Linux': 'libedgetpu.so.1', # install https://coral.ai/software/#edgetpu-runtime
379+
import tflite_runtime.interpreter as tfli # install https://coral.ai/software/#edgetpu-runtime
380+
delegate = {'Linux': 'libedgetpu.so.1',
381381
'Darwin': 'libedgetpu.1.dylib',
382382
'Windows': 'edgetpu.dll'}[platform.system()]
383383
interpreter = tfli.Interpreter(model_path=w, experimental_delegates=[tfli.load_delegate(delegate)])

0 commit comments

Comments
 (0)