Skip to content

[onnx/onnxruntime] ONNX_DISABLE_STATIC_REGISTRATION=ON is required for onnx when used with onnxruntime? #49060

@theoractice

Description

@theoractice

Describe the bug
My program that uses onnxruntime show warning messages below at runtime:

Schema error: Trying to register schema with name Abs (domain:  version: 1) from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 2758, but it is already registered from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 2758

Schema error: Trying to register schema with name Add (domain:  version: 1) from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 2642, but it is already registered from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\math\old.cc line 2642

Schema error: Trying to register schema with name And (domain:  version: 1) from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\logical\old.cc line 141, but it is already registered from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\logical\old.cc line 141

Schema error: Trying to register schema with name ArgMax (domain:  version: 1) from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\reduction\old.cc line 364, but it is already registered from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\reduction\old.cc line 364

Schema error: Trying to register schema with name ArgMin (domain:  version: 1) from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\reduction\old.cc line 366, but it is already registered from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\reduction\old.cc line 366

Schema error: Trying to register schema with name AveragePool (domain:  version: 1) from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\nn\old.cc line 2412, but it is already registered from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\nn\old.cc line 2412

Schema error: Trying to register schema with name BatchNormalization (domain:  version: 1) from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\nn\old.cc line 3325, but it is already registered from file D:\Coding\vcpkg\buildtrees\onnx\src\v1.19.0-c251c1eccc.clean\onnx\defs\nn\old.cc line 3325

... (And many of them)

Environment

  • OS: Win10
  • Compiler: VS 2022

To Reproduce
Just run some onnx model inference code

Expected behavior
No such warnings.

Additional context
Copilot tells me that ONNX_DISABLE_STATIC_REGISTRATION should be turned on for onnx, and it's actually mentioned here in onnxruntime port.

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