LoSealL / openvino2onnx

Convert OpenVINO IR (XML) to ONNX format
MIT License
8 stars 0 forks source link

Exception when converting from an optimized IR #6

Closed HugoGaquere closed 1 year ago

HugoGaquere commented 1 year ago

Description

I have converted this onnx model: yolox_s to OpenVino IR using OpenVino dev tools. Then I ran INT8 calibration with OpenVino Workbench. Now I want to to convert the resulting IR format to onnx using your tool. But I have the following error:

Traceback (most recent call last): File "C:\Users\Hugo.Gaquere\AppData\Local\anaconda3\envs\openvino\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Hugo.Gaquere\AppData\Local\anaconda3\envs\openvino\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\Hugo.Gaquere\AppData\Local\anaconda3\envs\openvino\Scripts\openvino2onnx.exe__main__.py", line 7, in File "C:\Users\Hugo.Gaquere\AppData\Local\anaconda3\envs\openvino\lib\site-packages\openvino2onnx\cli\main_cli.py", line 46, in main graph = ir_to_graph(model_url, args.model_bin) File "C:\Users\Hugo.Gaquere\AppData\Local\anaconda3\envs\openvino\lib\site-packages\openvino2onnx\ir11.py", line 127, in ir_to_graph graph = nx.MultiDiGraph(name=name, **graph_info) TypeError: networkx.classes.multidigraph.MultiDiGraph() got multiple values for keyword argument 'name'

To Reproduce

  1. Download Yolox S model: yolox_s
  2. Convert it using OpenVino dev tool: mo --input_model yolox_s.onnx
  3. Run INT8 calibration using OpenVino Workbench: -> here the resulting files yolox_ir.zip
  4. Then convert it back to onnx: openvino2onnx yolox_s.xml --model-bin yolox_s.bin
LoSealL commented 1 year ago

Hi @HugoGaquere On the first hand, this is because a duplicated "name" tag in rt_info, which is easy to overcome. On the other hand, converting quantized model from openvino to onnx is not supported for now, nor in my current roadmap.

I shall improve the error message to point out the exact missing places.

Hoping to hear your responces.

LoSealL commented 1 year ago

Solved by the latest commit #10 #11