当前位置:   article > 正文

openvino编译Inference Engine范例报“ngraph“的错_openvino ngraph

openvino ngraph

在Windows上安装好openvino
进入CMD输入:

cd C:\Program Files (x86)\Intel\openvino_2021\bin\
setupvars.bat
cd C:\Program Files (x86)\Intel\openvino_2021\deployment_tools\model_optimizer\install_prerequisites
install_prerequisites_caffe.bat
cd C:\Program Files (x86)\Intel\openvino_2021.2.185\inference_engine\samples\cpp
build_samples_msvc.bat
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

报错

CMake Error at ngraph_function_creation_sample/CMakeLists.txt:15 (find_package):
  By not providing "Findngraph.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "ngraph", but
  CMake did not find one.

  Could not find a package configuration file provided by "ngraph" with any
  of the following names:

    ngraphConfig.cmake
    ngraph-config.cmake

  Add the installation prefix of "ngraph" to CMAKE_PREFIX_PATH or set
  "ngraph_DIR" to a directory containing one of the above files.  If "ngraph"
  provides a separate development package or SDK, be sure it has been
  installed.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

转到项目目录
C:\Program Files (x86)\Intel\openvino_2021.2.185\inference_engine\samples\cpp
打开CMakeLists.txt文件
向其中添加 ngraphConfig.cmake路径
ngraphConfig.cmake文件放在 C:\Program Files (x86)\Intel\openvino_2021.2.185\deployment_tools\ngraph\cmake
CMakeLists.txt文件修改如下:

	##
  # 设置ngraph的CMake路径 C:/Program Files (x86)/Intel/openvino_2021.2.185/deployment_tools/ngraph/cmake
  set(ngraph_DIR "C:/Program Files (x86)/Intel/openvino_2021.2.185/deployment_tools/ngraph/cmake")
  find_package (ngraph REQUIRED)
  if(ngraph_FOUND)
      INCLUDE_DIRECTORIES(${ngraph_INCLUDE_DIRS})
      message(STATUS "ngraph library status:")
      message(STATUS "    version: ${ngraph_VERSION}")
      message(STATUS "    libraries: ${NGRAPH_LIBRARIES}")
      message(STATUS "    include path: ${NGRAPH_INCLUDE_DIRS}")
  endif()
  ##
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

如下图所示
在这里插入图片描述生成的项目地址在

 C:\Users\Administrator\Documents\Intel\OpenVINO\inference_engine_cpp_samples_build\
  • 1

在inference_engine_cpp_samples_build文件夹中的intel64\Release文件夹里面可以找到编译好的可执行文件(.exe)

参考文献:

运行exe报错
出现dll加载错误 : 找不到tbb.dll ngraph.dll
在环境变量中添加

C:\Program Files (x86)\Intel\openvino_2021.2.185\deployment_tools\ngraph\lib
C:\Program Files (x86)\Intel\openvino_2021.2.185\deployment_tools\inference_engine\external\tbb\bin
  • 1
  • 2

参考文献

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/161535
推荐阅读
相关标签
  

闽ICP备14008679号