RapidAI / RapidStructure

版面分析 | 表格识别 | 文档方向分类
Apache License 2.0
172 stars 12 forks source link

directML causes error in rapid orientation #24

Open ragebear00 opened 1 month ago

ragebear00 commented 1 month ago

rapid orientation does not work after install directML as below The issue can be resolve only after uninstall directML and reinstall onnxruntime

from .rapid_orientation import RapidOrientation File "C:\Users\abc\AppData\Local\Programs\Python\Python310\lib\site-packages\rapid_orientation\rapid_orientation.py", line 25, in from .utils import OrtInferSession, create_operators File "C:\Users\abc\AppData\Local\Programs\Python\Python310\lib\site-packages\rapid_orientation\utils.py", line 10, in from onnxruntime import (GraphOptimizationLevel, InferenceSession, File "C:\Users\abc\AppData\Local\Programs\Python\Python310\lib\site-packages\onnxruntime__init.py", line 57, in raise import_capi_exception File "C:\Users\abc\AppData\Local\Programs\Python\Python310\lib\site-packages\onnxruntime\init__.py", line 23, in from onnxruntime.capi._pybind_state import ExecutionMode # noqa: F401 File "C:\Users\abc\AppData\Local\Programs\Python\Python310\lib\site-packages\onnxruntime\capi_pybind_state.py", line 32, in from .onnxruntime_pybind11_state import * # noqa ImportError: DLL load failed while importing onnxruntime_pybind11_state: A dynamic link library (DLL) initialization routine failed.

SWHL commented 1 month ago

The rapid orientation package has not supported the DirectML.

ragebear00 commented 1 month ago

Understood, the rapid orientation and rapidocr directML now have a conflict. So if some one need to use 'rapid orientation', she cannot upgrade rapidocr directML.

Any chance to have two onnxruntime work at the same machine? so rapid orientation package can refer to onnxruntime, and rapidocr directML can import onnxruntime directML

SWHL commented 1 month ago

The onnxruntime-directml and onnxruntime can't installed at the same time. Only one of them can be installed.

The solution I can think of is that rapid orientation also supports onnxruntime directml.

You can use both directml or neither at the same time.