You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(paddle) (base) root@ubuntu20:~/OnnxSlim# python
Python 3.10.15 (main, Oct 3 2024, 07:27:34) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import onnxruntime as rt
>>> sess = rt.InferenceSession('slim.onnx')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/root/miniconda3/envs/paddle/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in __init__
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/root/miniconda3/envs/paddle/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 480, in _create_inference_session
sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from slim.onnx failed:Node (Loop.0) Op (Loop) [TypeInferenceError] Graph attribute inferencing failed: Size mismatch validating subgraph inputs. Got 29 inputs but subgraph has 25 inputs and requires 25 inputs. Either provide all subgraph inputs, or just the required inputs.
When a model contains subgraph, it's usually a good practice to not remove unused inputs, because for subgraph, unused inputs works like Identity operator to pass information down
Steps to reproduce
The text was updated successfully, but these errors were encountered: