Skip to content

Missing attribute in Split-18 not reported by checker #5222

@ghost

Description

Bug Report

Is the issue related to model conversion?

No

Describe the bug

An error occurred in the version converter, convert Split from opset11 to 18 failed. The converted Split-18 has neither input 'split' nor attribute 'num_outputs', but the onnx.checker.check_model does not report an error, and the onnxruntime does not work.

System information

  • OS Platform and Distribution: Linux Ubuntu 20.04
  • ONNX version: 1.14.0
  • Python version: Python 3.9

Reproduction instructions

  • Operator description:
    Split-11: There is only 'axis' in the attribute, not 'split'.
    Converted split-18: There is only 'axis' in the attribute, neither input 'split' nor attribute 'num_outputs'.
import onnx
import onnxruntime
model = onnx.load('model.onnx')
model = onnx.version_converter.convert_version(model, 18)
onnx.checker.check_model(model)  # success
sess = onnxruntime.InferenceSession(model.SerializeToString())  # fail

Expected behavior

1.onnx.checker.check_model can check for model errors 2. the version converter can give the correct Split-18.

Notes

error:
onnxruntime.capi.onnxruntime_pybind11_state.Fail:[ONNXRuntimeError]:1:FAIL:Node(Split_1)Op (Split)[ShapeInferenceError] Neither 'Split' input nor 'num_outputs' attribute has been given.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions