microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.61k stars 2.92k forks source link

run onnxruntime-directml failed due to ops #21875

Open ziyanxzy opened 2 months ago

ziyanxzy commented 2 months ago

Describe the issue

Traceback (most recent call last): File "test-paraformer-onnx.py", line 133, in main() File "test-paraformer-onnx.py", line 119, in main outputs = sess.run(output_names, input_feed=inputs) File "C:\Users\LNL\miniforge3\envs\para_3.8\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 220, in run return self._sess.run(output_names, input_feed, run_options) onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Loop node. Name:'Loop_5471' Status Message: Non-zero status code returned while running Squeeze node. Name:'Squeeze_5478' Status Message: D:\a_work\1\s\onnxruntime\core\providers\dml\DmlExecutionProvider\src\MLOperatorAuthorImpl.cpp(2804)\onnxruntime_pybind11_state.pyd!00007FFE88F378A0: (caller: 00007FFE88F03705) Exception(1) tid(4a14) 80070057 The parameter is incorrect.

To reproduce

https://hf-mirror.com/csukuangfj/paraformer-onnxruntime-python-example/tree/main

change onnxruntime to onnxruntime-directml modify test-paraformer-onnx and use DmlExecutionProvider: features = compute_feat() features = np.expand_dims(features, axis=0) features_length = np.array([features.shape[1]], dtype=np.int32)

session_opts = onnxruntime.SessionOptions()

providers = ['DmlExecutionProvider','CPUExecutionProvider']
print(f'available providers : {providers}')

# session_opts.log_severity_level = 3  # error level

sess = onnxruntime.InferenceSession("model.onnx", providers=providers)

Urgency

No response

Platform

Windows

OS Version

windows11

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

onnxruntime-directml==1.19.0

ONNX Runtime API

Python

Architecture

X64

Execution Provider

DirectML

Execution Provider Library Version

DmlExecutionProvider

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.