Skip to content

ORT raises node "does not have type information set by parent node" for initializers declared in outer graph #24880

Open
@justinchuby

Description

@justinchuby

Describe the issue

Checked in

if (is_outer_scope_nodearg(input_def->Name()))
and manifested in
# Add type info, otherwise ORT will raise error: "input arg (*) does not have type information set by parent node."
for initializer in moved_initializers:
shape = onnx.numpy_helper.to_array(initializer).shape
value_info = onnx.helper.make_tensor_value_info(initializer.name, initializer.data_type, shape)
graph.value_info.append(value_info)

is_outer_scope_nodearg doesn't seem to return true when the node input is an initializer defined in the outer graph (w/o having a value_info proto in the subgraph).

To reproduce

Produce a node with a subgraph that references an outer graph, and do not create a value_info for the initializer in the subgraph.

The node I observed was from

Urgency

No response

Platform

Linux

OS Version

N/A

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.22

ONNX Runtime API

Python

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

Labels

core runtimeissues related to core runtimemodel:transformerissues related to a transformer model: BERT, GPT2, Hugging Face, Longformer, T5, etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions