[英]Unable to infer results using tflite object detection model
我通過重新訓練 model 成功地將 ssd_mobilenet_v3 model 轉換為 a.tflite。 (之前在 coco 數據集上訓練過)
但是,在使用此 model 進行 object 檢測以使用以下代碼對單個圖像運行推理時:
interpreter = tf.lite.Interpreter(model_path)
我收到以下錯誤:
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.
請解釋錯誤和可能的解決方案。
Tensorflow 版本:1.1.4
操作系統:Ubuntu 18.04
Python:3.7
PS:我將分類器model(inception_v2)轉換為tflite並使用上面的代碼(“interpreter = tf.lite.Interpreter(model_path)”)沒有任何錯誤!
將 tensorflow 版本更新為 >=2.0.0
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.