【问题标题】:Getting error while importing onnxruntime ImportError: cannot import name 'get_all_providers' (Windows 10)导入 onnxruntime ImportError 时出错:无法导入名称“get_all_providers”(Windows 10)
【发布时间】:2021-02-11 14:06:57
【问题描述】:

我已经在我的环境中安装了 onnxruntime-gpu 库

pip install onnxruntime-gpu==1.2.0

nvcc --version output
Cuda compilation tools, release 10.1, V10.1.105

>>> import onnxruntime
C:\Users\abgangwa\AppData\Local\Continuum\anaconda3\envs\onnx_gpu\lib\site-packages\onnxruntime\capi\_pybind_state.py:13: UserWarning: Cannot load onnxruntime.capi. Error: 'DLL load failed: The specified module could not be found.'
  warnings.warn("Cannot load onnxruntime.capi. Error: '{0}'".format(str(e)))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\abgangwa\AppData\Local\Continuum\anaconda3\envs\onnx_gpu\lib\site-packages\onnxruntime\__init__.py", line 12, in <module>
    from onnxruntime.capi._pybind_state import get_all_providers, get_available_providers, get_device, RunOptions, SessionOptions, set_default_logger_severity, NodeArg, ModelMetadata, GraphOptimizationLevel, ExecutionMode
ImportError: cannot import name 'get_all_providers'

请帮我解决这个错误

尝试了现有的解决方案。他们都没有工作

【问题讨论】:

    标签: importerror onnx onnxruntime


    【解决方案1】:

    很可能 CUDA dll 不在路径中,因此在 python 加载 onnxruntime 库时找不到。

    此回复包含指向有关解决此问题的文章的链接。

    https://github.com/microsoft/onnxruntime/issues/4196#issuecomment-808787338

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-22
      相关资源
      最近更新 更多