Version converter 11 -> 12 fails with "IndexError: Input s is undefined!"
See original GitHub issueBug Report
Describe the bug
The version converter fails on the attached model (and not becase the adapter is missing)
System information
- OS Platform and Distribution: Ubuntu 18.04
- ONNX version: 1.7 release commit
- Python version: 3.6.9
- GCC/Compiler version: 7.5.0
- CMake version: 3.17.3
- Protobuf version: 3.12
Reproduction instructions
import onnx
from onnx import version_converter, helper
# Preprocessing: load the model to be converted.
model_path = "path/to/shared-bn-arrays-v11.onnx"
original_model = onnx.load(model_path)
converted_model = version_converter.convert_version(original_model, 12)
print("done!")
The script doesn’t get to the final print, but fails with
Traceback (most recent call last):
File "script.py", line 8, in <module>
converted_model = version_converter.convert_version(original_model, 12)
File "/usr/local/lib/python3.6/dist-packages/onnx-1.7.0-py3.6-linux-x86_64.egg/onnx/version_converter.py", line 166, in convert_version
converted_model_str = C.convert_version(model_str, target_version)
IndexError: Input s is undefined!
- ONNX model shared-bn-arrays-v11.zip
Expected behavior
The script should not fail and properly upgrade the model (or at least fail saying there are no adapters)
Issue Analytics
- State:
- Created 3 years ago
- Comments:24 (13 by maintainers)
Top Results From Across the Web
12 fails with "IndexError: Input s is undefined!" - Bountysource
Version converter 11 -> 12 fails with "IndexError: Input s is undefined!"
Read more >caffe2 inference a onnx model , happend IndexError: Input ...
I believe it is related to IR gap issue: ... GraphProto): inputs = {i.name for i in graph.input} existing_info = {vi.name: vi for...
Read more >List Index Out of Range – Python Error Message Solved
Using an index number that is out of the range of the list. You'll get the Indexerror: list index out of range error...
Read more >php gives undefined index error Code Example - Code Grepper
$_POST['yy'] : ""; // This is on line 11. 2. $_SESSION['mm'] = isset($_POST['mm']) ? $_POST['mm'] : ""; // This is on line 12....
Read more >Firebase JavaScript SDK Release Notes - Google
Updated firebase/[product] entry point bundles to conform to Node.js ES module ... Updated "missing index" error message to include the link to create...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
still not working, even with IR 6 and latest code on master today, and the fix proposed…
Hi @ZhangXiaoying0116, Thank you for catching this! I referenced a wrong code… This one should be the right one: https://github.com/onnx/onnx/issues/2995#issuecomment-687631931 (add_input_from_initializer). I will correct my response above as well.