Skip to content

[IR] Error when parsing NodeProto #2093

Closed
@Johansmm

Description

@Johansmm

ir.from_proto raises an exception for NodeProto:

import onnxscript
import onnx

node = onnx.helper.make_node('Conv', ['X', 'W'], ['Y'])
onnxscript.ir.from_proto(node) # Error here

Error logs:

Input 'X' of node '(::Conv:)' not found in any scope. The graph may be unsorted. Creating a new input (current depth: 0) .
Traceback (most recent call last):
  File "D:\.envs\onnx\Lib\site-packages\onnxscript\ir\serde.py", line 98, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "D:\.envs\onnx\Lib\site-packages\onnxscript\ir\serde.py", line 975, in _deserialize_node
    scoped_values[-1][input_name] = value
    ~~~~~~~~~~~~~^^^^
IndexError: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\.envs\onnx\Lib\site-packages\onnxscript\ir\serde.py", line 160, in from_proto
    return deserialize_node(proto)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\.envs\onnx\Lib\site-packages\onnxscript\ir\serde.py", line 921, in deserialize_node
    return _deserialize_node(proto, scoped_values=[], value_info={})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\.envs\onnx\Lib\site-packages\onnxscript\ir\serde.py", line 100, in wrapper
    raise SerdeError(
onnxscript.ir.serde.SerdeError: Error calling _deserialize_node with: input: "X"
input: "W"
output: "Y"
op_type: "Conv"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions