-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
staleissues that have not been addressed in a while; categorized by a botissues that have not been addressed in a while; categorized by a bot
Description
Expected behavior
onnxruntime should run the model when using the optimization ORT_ENABLE_BASIC.
Actual behavior
When using the optimization ORT_ENABLE_BASIC, onnxruntime crashes.
Traceback (most recent call last):
File "/home/carla/Documents/test_onnxruntime/0322/test.py", line 18, in <module>
ort_session = onnxruntime.InferenceSession(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/carla/anaconda3/envs/nnsmith-onnxruntime/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 472, in __init__
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/home/carla/anaconda3/envs/nnsmith-onnxruntime/lib/python3.11/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 544, in _create_inference_session
sess.initialize_session(providers, provider_options, disabled_optimizers)
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/optimizer/relu_clip_fusion.cc:77 virtual onnxruntime::common::Status onnxruntime::FuseReluClip::Apply(onnxruntime::Graph&, onnxruntime::Node&, onnxruntime::RewriteRule::RewriteRuleEffect&, const onnxruntime::logging::Logger&) const Unexpected data type for Clip 'min' input of 11To reproduce
Environment
OS: Ubuntu 20.04
onnxruntime: 1.22.0.dev20250320003
Steps to reproduce
This bug can be reproduced by the following code with the model in the attachment. For the model, it can be correctly checked by onnx.checker.check_model. However, if we replace ORT_ENABLE_BASIC with ORT_DISABLE_ALL, every thing is ok.
from typing import Dict, List, Literal, Optional
import sys
import numpy as np
import onnx
import onnxruntime
model_path = "model.onnx"
onnx_model = onnx.load(model_path)
onnx.checker.check_model(onnx_model)
sess_options = onnxruntime.SessionOptions()
sess_options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_BASIC
ort_session = onnxruntime.InferenceSession(
onnx_model.SerializeToString(), sess_options, providers=["CPUExecutionProvider"]
) Urgency
No response
Platform
Linux
OS Version
Ubuntu 20.04
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
1.22.0.dev20250320003
ONNX Runtime API
Python
Architecture
X64
Execution Provider
Default CPU
Execution Provider Library Version
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleissues that have not been addressed in a while; categorized by a botissues that have not been addressed in a while; categorized by a bot