Open jcsm89 opened 1 year ago
The specifications have remained that way since the beginning. It is a TensorFlow specification rather than a tool issue. Therefore, I am deprecating output by h5.
The situation may not change much, but if you own an onnx, I recommend the following tool, which I have been actively maintaining recently. The conversion efficiency is much higher than openvino2tensorflow.
https://github.com/PINTO0309/onnx2tf
I checked only the structure of the model with Netron, and it looks like a simple model with fairly low conversion difficulty, so it will probably succeed.
I will be out of town for three days starting today and will not be able to operate a PC, so I can only read the text of the issue on my tablet.
Issue Type
Performance
OS
Windows
OS architecture
x86_64
Programming Language
Python
Framework
TensorFlow
Download URL for ONNX / OpenVINO IR
https://drive.google.com/drive/folders/1Di7vhQfd-5DLGDUSII1_NxLvEvs2fXpI?usp=sharing
Convert Script
Conversion was performed on the model.xml OpenVino model (included in the Drive directory above) with the unchanged openvino2tensorflow.py script (commit hash 63fff406a2bd44258c91521add6efc8acf899808). I tested both on the Docker and on a local clone of the repository and the same issue was observed.
python openvino2tensorflow.py --model_path C:\dev\openvino_model\model.xml --output_weight_and_json --model_output_path C:\dev\converted_model
Description
While converting an OpenVino model to Tensorflow (in json architecture + h5 weights format) it was observed that the size of the resulting files (namely the json file) was much larger than the original model in OpenVino format. More precisely, the original OpenVino bin file was 254MB in size, while the resulting json was 1394MB and the resulting h5 weights file was 205MB in size.
All models are included in the Google Drive folder shared above, including the original ONNX model (can also be downloaded in its original form from https://drive.google.com/file/d/1Gh8C-bwl2B90RDrvKJkXafvZC3q4_H_z/view?usp=sharing). The conversion to OpenVino was performed using OpenVino 2021.4.1, with all the details consultable in the metadata section of the xml file.
We noticed that the resulting architecture file has a lot of numeric values in it, whereas a normal json architecture file only has info about the tensors and how they are connected to form the full model scheme. Not sure if this helps in any way to pinpoint the issue.
Also of note that the number of parameters in the model is consistent when loading the converted model in Python using load_model, which seems to indicate that the architecture and the weights are consistent but, for some reason, occupy a lot more space in disk. Also, the models take a long time to load in Python and timeout Netron visualization.
If you need any more details just let me know and thanks in advance!
conversion_logs.txt
Relevant Log Output
Source code for simple inference testing code
Just run the conversion script pointing to model.xml and it should output the large json + similar sized h5 weights file.