tflite\u运行时:“op内置代码超出范围:131。您是否将旧的tflite二进制文件用于较新的模型?”用于YAMNET模型

2021-12-08 04:38:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用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但是我得到了同样的问题。我已经在互联网上搜索过了,但是我尝试过的都没有成功

你知道为什么会出现这个问题吗