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
`ValueError: axes don't match array` when converting Yolov5s model #115
ValueError: Dimensions must be equal, but are 80 and 3 for '{{node tf.math.add_54/Add}} = AddV2[T=DT_FLOAT](Placeholder, tf.math.add_54/Add/y)' with input shapes: [1,80,3,17,2], [1,3,80,80,2].
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/datadrive/mikel/venvs/yolov5/bin/openvino2tensorflow", line 1056, in convert
tf_layers_dict[layer_id] = tf.math.add(tf_layers_dict[edge_id0], tf_layers_dict[edge_id1].transpose(0,2,3,1))
ValueError: axes don't match array
ERROR: Please refer to 6-7 in the README first. https://github.com/PINTO0309/openvino2tensorflow
Issue Type
Bug
OS
Ubuntu
OS architecture
x86_64
Programming Language
Python
Framework
OpenVINO
Download URL for ONNX / OpenVINO IR
ONNX generated from Yolov5s with the export tool provided here: https://github.com/ultralytics/yolov5/blob/master/export.py
Convert Script
Description
ONNX is exported to OpenVINO by:
mo --input_model /path/to/my/yolov5s_best.onnx --output_dir ./openvino --data_type FP32
Then I use:
for TFLite conversion, where replace.json is:
Relevant Log Output
Source code for simple inference testing code
No response