使用onnx进行推理遇到的问题
1. Python37\lib\site-packages\onnxruntime\capi_pybind_state.py:14: UserWarning: Cannot load onnxruntime.capi. Error: ‘DLL load failed: 找不到指定的模块。’
2. Python\Python37\lib\site-packages\onnxruntime\capi_pybind_state.py:25: UserWarning: Unless you have built the wheel using VS 2017, please install the 2019 Visual C++ runtime and then try again warnings.warn("Unless you have built the wheel using VS 2017, "
3. from onnxruntime.capi._pybind_state import get_all_providers, get_available_providers, get_device, set_seed, \ImportError: cannot import name ‘get_all_providers’ from ‘onnxruntime.capi._pybind_state’
解决方法:
使用pip install onnxruntime 安装的是onnxruntime 1.5.2版本,版本过高,
通过pip install onnxruntime==1.2.0(及以下,如1.1.2等均可解决),解决上述问题。