[英]Unable to infer results using tflite object detection model
I successfully converted a ssd_mobilenet_v3 model into a.tflite by retraining the model.我通过重新训练 model 成功地将 ssd_mobilenet_v3 model 转换为 a.tflite。 (previously trained on coco dataset)
(之前在 coco 数据集上训练过)
But while using this model for object detection to run inference on a single image using the following code:但是,在使用此 model 进行 object 检测以使用以下代码对单个图像运行推理时:
interpreter = tf.lite.Interpreter(model_path)
I am getting the following error:我收到以下错误:
ValueError Traceback (most recent call last)
<ipython-input-15-e1c9008b610c> in <module>
----> 1 interpreter = tf.lite.Interpreter("/home/sushanth/Documents /nuts_poc/tflite_od/nam_model_quantized.lite")
2 interpreter.allocate_tensors()
3 input_details = interpreter.get_input_details()
4 output_details = interpreter.get_output_details()
5 input_tensor_index = interpreter.get_input_details()[0]["index"]
~/.local/lib/python3.7/site-packages/tensorflow/lite/python/interpreter.py in __init__(self, model_path, model_content)
75 self._interpreter = (
76 _interpreter_wrapper.InterpreterWrapper_CreateWrapperCPPFromFile(
---> 77 model_path))
78 if not self._interpreter:
79 raise ValueError('Failed to open {}'.format(model_path))
ValueError: Op builtin_code out of range: 117. Are you using old TFLite binary with newer model?Registration failed.
Kindly explain the error and a possible solution.请解释错误和可能的解决方案。
Tensorflow Version: 1.1.4 Tensorflow 版本:1.1.4
OS: Ubuntu 18.04操作系统:Ubuntu 18.04
Python: 3.7 Python:3.7
PS: I converted a classifier model (inception_v2) into tflite and used the above code ("interpreter = tf.lite.Interpreter(model_path)") without any error! PS:我将分类器model(inception_v2)转换为tflite并使用上面的代码(“interpreter = tf.lite.Interpreter(model_path)”)没有任何错误!
Update tensorflow version to >=2.0.0将 tensorflow 版本更新为 >=2.0.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.