0

I am trying to compile OpenCV with OpenVino inference as explained here:

https://github.com/opencv/opencv/wiki/Intel's-Deep-Learning-Inference-Engine-backend

but when I try to generate the MSVC (2017) project on windows, I am getting this error:

CMake Error at C:/local/Intel/computer_vision_sdk_2018.5.445/deployment_tools/inference_engine/src/extension/cmake/CPUID.cmake:324 (file):
  file STRINGS file "C:/local/opencv-build/cpuid.txt" cannot be read.
Call Stack (most recent call first):
  C:/local/Intel/computer_vision_sdk_2018.5.445/deployment_tools/inference_engine/src/extension/cmake/feature_defs.cmake:17 (include)
  C:/local/Intel/computer_vision_sdk_2018.5.445/deployment_tools/inference_engine/src/extension/CMakeLists.txt:9 (include)

Tools used:

  • OpenCV 4.0.0 source code
  • OpenVino 5.0.1
  • Visual Studio 2017
  • CMake-Gui 3.13
Mat
  • 1,440
  • 1
  • 18
  • 38
mans
  • 17,104
  • 45
  • 172
  • 321
  • Why aren't you following the [official installation guide](https://software.intel.com/en-us/articles/OpenVINO-Install-Windows)? I think OpenVino setup comes with a predefined version of OpenCV. – zindarod Feb 09 '19 at 14:33
  • @zindarod The official version is a dll version for VS and I want to build OpenCV with Inference engine and in static form. I want to build an application that I can ship as one *.exe file in windows. – mans Feb 09 '19 at 16:28
  • Try this workaround: https://github.com/opencv/open_model_zoo/issues/20#issuecomment-447283964. Or use command line CMake. – Dmitry Kurtaev Feb 10 '19 at 02:42
  • Well, have you checked if the file `C:/local/opencv-build/cpuid.txt` exists and is accessible ? – Mat Feb 25 '19 at 20:11
  • @Mat No it doesn't exist and I don't know why it was not generated. – mans Feb 26 '19 at 21:19

3 Answers3

0

I think you have installed inappropriate versions for some tools. Please try to use CMake 3.4 or higher, which is required to build the Intel® Distribution of OpenVINO.

Please try to follow the steps from "https://software.intel.com/en-us/articles/OpenVINO-Install-Windows" for installation and verify whether you are able to compile OpenCV with OpenVino inference.

Rahila T - Intel
  • 832
  • 4
  • 11
0

There's a forum post over on OpenVino that indicates some hacky solution to this problem. Here's the suggested solution:

In ...\Intel\computer_vision_sdk_2018.5.456\deployment_tools\inference_engine\src\extension\cmake\CPUID.cmake (assuming you followed the default OpenVino Toolkit installation, otherwise you'd need to first locate that file from where you installed it), try making the following change on line 251:

// std::ofstream fo(\"cpuid.txt\"); old line
std::ofstream fo(\"${CMAKE_BINARY_DIR}/cpuid.txt\");

*Make sure the variable name fo is consistent with the code following it.

This can potentially avoid having inconsistent paths as the line 319 of that same file gets the text file like this:

set(_CPUID_INFO "${CMAKE_BINARY_DIR}/cpuid.txt")

From the stack trace, it seems like your ${CMAKE_BINARY_DIR} variable is set to C:/local/opencv-build, so you should expect cpuid.txt to be generated there.

Mat
  • 1,440
  • 1
  • 18
  • 38
0

I also met this error, but I changed this line of CPUID.cmake as shown in the followng:

if(HAVE_CPUID_INFO)
    set(_CPUID_INFO "/home/huihui/intel/computer_vision_sdk_2018.4.420/inference_engine/build/cpuid.txt")

Now the error is fixed.

AS Mackay
  • 2,831
  • 9
  • 19
  • 25
Paul Peter
  • 31
  • 3