question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version converter 11 -> 12 fails with "IndexError: Input s is undefined!"

See original GitHub issue

Bug 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!

Expected behavior

The script should not fail and properly upgrade the model (or at least fail saying there are no adapters)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (13 by maintainers)

github_iconTop GitHub Comments

6reactions
mikesevencommented, Jul 2, 2021

still not working, even with IR 6 and latest code on master today, and the fix proposed…

1reaction
jcwchencommented, Dec 14, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found