问题描述
我正在尝试在我的 Coral Dev Board Mini 上使用 YAMNET model made for the Coral Board,但我无法让它工作,因为我收到以下错误:
Traceback (most recent call last):
File "<stdin>",line 1,in <module>
File "/home/mendel/classifier_env/lib/python3.7/site-packages/tflite_runtime/interpreter.py",line 207,in __init__
custom_op_registerers_by_func))
ValueError: Op builtin_code out of range: 131. Are you using old TFLite binary with newer model?Registration Failed.
我使用的代码片段是:
import tflite_runtime.interpreter as tflite
delegate = tflite.load_delegate('libedgetpu.so.1')
interpreter = tflite.Interpreter(model_path='coral_yamnet.tflite',experimental_delegates=[delegate])
如果我不使用委托,我会得到同样的错误。
我的 tflite_runtime
版本是:
>>> pip show tflite_runtime
Name: tflite-runtime
Version: 2.5.0
Summary: TensorFlow Lite is for mobile and embedded devices.
Home-page: https://www.tensorflow.org/lite/
Author: Google,LLC
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /home/mendel/classifier_env/lib/python3.7/site-packages
Requires: numpy
required-by:
我使用的是 Python 3.7.3。
我也尝试在我的计算机上使用 tensorflow.lite.Interpreter
使用它,但我遇到了完全相同的问题。我已经在互联网上搜索过,但我试过的都没有效果...
你知道为什么会出现这个问题吗?
解决方法
请使用 TensorFlow pip 的匹配版本,该版本用于 TFLite 转换,而不是 tflite_runtime 库。
上述 tflite_runtime 包与用于 TFLite 转换的 TensorFlow 版本不一致。