PINTO0309 / openvino2tensorflow

This script converts the ONNX/OpenVINO IR model to Tensorflow's saved_model, tflite, h5, tfjs, tftrt(TensorRT), CoreML, EdgeTPU, ONNX and pb. PyTorch (NCHW) -> ONNX (NCHW) -> OpenVINO (NCHW) -> openvino2tensorflow -> Tensorflow/Keras (NHWC/NCHW) -> TFLite (NHWC/NCHW). And the conversion from .pb to saved_model and from saved_model to .pb and from .pb to .tflite and saved_model to .tflite and saved_model to onnx. Support for building environments with Docker. It is possible to directly access the host PC GUI and the camera to verify the operation. NVIDIA GPU (dGPU) support. Intel iHD GPU (iGPU) support.
MIT License
334 stars 40 forks source link

Unable to convert yolov8 openvino model to tensorflow #141

Closed Arslan-Mehmood1 closed 1 year ago

Arslan-Mehmood1 commented 1 year ago

Issue Type

Bug

OS

Ubuntu

OS architecture

x86_64

Programming Language

Python

Framework

OpenVINO

Download URL for ONNX / OpenVINO IR

Conversion Log:

2023-08-23 15:13:46.392694: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used. 2023-08-23 15:13:46.865545: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used. 2023-08-23 15:13:48.608017: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT TensorFlow/Keras model building process starts ====================================== Layer structure ===================================================================== ERROR: invalid literal for int() with base 10: '?' ERROR: model_path : my_yolov8.xml ERROR: weights_path: my_yolov8.bin ERROR: layer_id : 0 ERROR: The trace log is below. Traceback (most recent call last): File "/home/arslan/.local/bin/openvino2tensorflow", line 616, in convert shape = [int(s) for s in shape_str] File "/home/arslan/.local/bin/openvino2tensorflow", line 616, in shape = [int(s) for s in shape_str] ValueError: invalid literal for int() with base 10: '?' ERROR: Please refer to 6-7 in the README first. https://github.com/PINTO0309/openvino2tensorflow

Convert Script

openvino2tensorflow --model_path my_yolov8.xml \ --model_output_path conversion_output \ --output_no_quant_float32_tflite

Description

the yolov8 model should be converted to tf ltie model, which I need for EdgeTPU conversion and inference.

Relevant Log Output

**Conversion Log:**

2023-08-23 15:13:46.392694: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-08-23 15:13:46.865545: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2023-08-23 15:13:48.608017: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
TensorFlow/Keras model building process starts ======================================
Layer structure =====================================================================
**ERROR: invalid literal for int() with base 10: '?'**
ERROR: model_path  : my_yolov8.xml
ERROR: weights_path: my_yolov8.bin
ERROR: layer_id    : 0
**ERROR: The trace log is below.**
Traceback (most recent call last):
  File "/home/arslan/.local/bin/openvino2tensorflow", line 616, in convert
    shape = [int(s) for s in shape_str]
  File "/home/arslan/.local/bin/openvino2tensorflow", line 616, in <listcomp>
    shape = [int(s) for s in shape_str]
ValueError: invalid literal for int() with base 10: '?'
ERROR: Please refer to 6-7 in the README first. https://github.com/PINTO0309/openvino2tensorflow

Source code for simple inference testing code

no code

PINTO0309 commented 1 year ago

The implementation of this tool is very inefficient, so please use the latest tool here. You should have the model before converting to openvino.

https://github.com/PINTO0309/onnx2tf