编译OnnxRuntime+OpenVINO,提示"Unsupported OpenVINO version"(已解决)

昨天刚填完编译OnnxRuntime+OneDNN的坑,今天编译了一天的OnnxRuntime+OpenVINO,一直接提示Unsupported OpenVINO version,无法编译通过。

CMake Error at CMakeLists.txt:1253 (message):
  Unsupported OpenVINO version:


-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
  File "G:\FromGithub\onnxruntime\tools\ci_build\build.py", line 2684, in <module>
    sys.exit(main())
  File "G:\FromGithub\onnxruntime\tools\ci_build\build.py", line 2542, in main
    generate_build_tree(
  File "G:\FromGithub\onnxruntime\tools\ci_build\build.py", line 1422, in generate_build_tree
    run_subprocess(
  File "G:\FromGithub\onnxruntime\tools\ci_build\build.py", line 798, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
  File "G:\FromGithub\onnxruntime\tools\python\util\run.py", line 49, in run
    completed_process = subprocess.run(
  File "E:\Python\Python39\lib\subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,

查来查去,原来是自己下载OpenVINO ToolKit包时(w_openvino_toolkit_windows_2023.2.0.13089.cfd42bd2cb0_x86_64.zip),觉得名字太长了,改了一个CMake在是处理onnxruntime\cmake\CMakeList.txt文件时,无法通过路径来判断OpenVino的版本,如下代码

 # Check OpenVINO version for support
  if (${VER} MATCHES "2022.1" OR $ENV{INTEL_OPENVINO_DIR} MATCHES "2022.1")
    set(OPENVINO_VERSION "2022.1")
    add_definitions(-DOPENVINO_2022_1=1)
  elseif (${VER} MATCHES "2022.2" OR $ENV{INTEL_OPENVINO_DIR} MATCHES "2022.2")
    set(OPENVINO_VERSION "2022.2")
    add_definitions(-DOPENVINO_2022_2=1)
  elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "2022.3")
    set(OPENVINO_VERSION "2022.3")
    add_definitions(-DOPENVINO_2022_3=1)
  elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "2023.0")
    set(OPENVINO_VERSION "2023.0")
    add_definitions(-DOPENVINO_2023_0=1)
  elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "2023.1")
    set(OPENVINO_VERSION "2023.1")
    add_definitions(-DOPENVINO_2023_1=1)
  elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "openvino")
    set(OPENVINO_VERSION "2023.1")
    add_definitions(-DOPENVINO_2023_1=1)
  else()
    message(FATAL_ERROR "Unsupported OpenVINO version: ${INTEL_OPENVINO_DIR}")
  endif()

其中,INTEL_OPENVINO_DIR就是“setupvars.bat”所在文件夹。
导致一直提示"Unsupported OpenVINO version",坑,实在是坑!
注意,解压或安装的文件夹名需要包含版本号(如CMakeList.txt文件中的版本号)或 openvino(还区分大小写?!),最后路径如:“F:\openvino\”,编译通过。
CMake也有语法,也有错误提示,只是自己没早发现…

GitHub 加速计划 / on / onnxruntime
13.76 K
2.79 K
下载
microsoft/onnxruntime: 是一个用于运行各种机器学习模型的开源库。适合对机器学习和深度学习有兴趣的人,特别是在开发和部署机器学习模型时需要处理各种不同框架和算子的人。特点是支持多种机器学习框架和算子,包括 TensorFlow、PyTorch、Caffe 等,具有高性能和广泛的兼容性。
最近提交(Master分支:2 个月前 )
120cb5a8 ### Description Add I/O binding example using onnx data type in python API summary. The API is available since 1.20 release. ### Motivation and Context Follow up of https://github.com/microsoft/onnxruntime/pull/22306 to add some documentation. 17 小时前
4ffc1ff3 ### Description Fixes: (1) cpu kernel: applying scale before bias and mask like other MHA ops (2) cpu kernel: correct offset during appending past to present. (3) cuda kernel: apply mask if provided; fix output_qk offset. Add DMMHA unit tests 23 小时前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐