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

Openvino Yolov5 list index out of range #41

Closed BernardinD closed 3 years ago

BernardinD commented 3 years ago

1. Ubuntu 20.04

2. x86_64

3. Version of OpenVINO 2021.3.394

4. Version of TensorFlow v2.4.1

8. Version of ONNX 1.9.0

9. Download URL for ONNX model

https://drive.google.com/file/d/1RSbxNDlCDiaJLCKy_iyg19MOC6W7MIza/view?usp=sharing

10. Download URL for OpenVINO IR (.bin/.xml) model

https://drive.google.com/drive/folders/1Jy4_4wbwJXTNk-Lv1AYFSrN8mh8dWDUE?usp=sharing

11. URL of the repository from which the transformed model was taken

https://github.com/ultralytics/yolov5

13. Issue Details

We're trying to convert and customize a Yolov5 model in Keras since the EdgeTPU has issues with the 5DTranpose operation at the end and the openvino2tensorflow has issues with which dimensions to tranpose between the Openvino graph and Tensorflow.

The idea is to use openvino2tensorflow to get a Keras and then customize the output of that conversion but we get the index out of range error when attempting to load the Keras model

Any suggestions on how to workaround this workaround?

Update: I just found out an error is throw when saving the yolo TF/Keras model. Can't pickle module objects

PINTO0309 commented 3 years ago

The README has been substantially updated to describe how to replace weights and fixed parameters. This is a feature that was implemented six months ago to support 5DTranspose. https://github.com/PINTO0309/openvino2tensorflow#6-7-replace-weights-or-constant-values-in-const-op