Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.

re: C++ ov::Core leads to memory exception

niclas1992
Beginner
307 Views

Hello,

 

as described on the Intel Openvino webpage, I have installed OpenVino using the installer and the development tools using the indicated command line tool commands. I created a little test project and following the instructios "Integrate OpenVino with your project" I applied following code:

 

#include <openvino/openvino.hpp>
#include <ie_core.hpp>
int main(){
	ov::Core core;


	ov::CompiledModel compiled_model = core.compile_model("model.xml", "AUTO");

	ov::InferRequest infer_request = compiled_model.create_infer_request();

	infer_request.start_async();
	infer_request.wait();
	std::cout << 1;
	return 0;

}

 

 I built that project with Visual Studio 2019 on Windows 10. In the project settings I put the lib path of openvino.lib, the include path, and I copied the openvino.dll and the tbb.dll files next to the .exe of my test project. However, the first line alread throws following error: 

Unhandled exception at 0x00007FFBCB174F69 in openvino.exe: Microsoft C++ exception: ov::Exception at memory location 0x0000006701BEF880

The error gets thrown in the line 4 already.

Of course I also tried, open the .exe using the commando line tool, after executing setupvars.bat in the same commando line window. This didn't work either. After removing related .dll filese it didn't work either.

Can you see what I'm doing wrong here?

Best Regards

Niclas

 

0 Kudos
2 Replies
Iffa_Intel
Moderator
277 Views

Greetings,

 

the easiest way to create a custom project based on OpenVINO is by using one of the Official OpenVINO sample/demo. This way, you don't have to link the required libraries manually which you might miss.

 

Steps to create a custom project with OpenVINO Inference Engine: 

  1. Install OpenVINO and its pre-requisites. 

  2. Run setupvars.bat before running any OpenVINO sample to verify the installation. 

  3. Create a backup folder for the original sample. 

  4. Choose one sample demo as the base and delete the rest. 

  5. If the sample application name is changed, also change to the same name in CMakeLists.txt. 

  6. Run cmake via Command Prompt (CMD). 

  7. Navigate to the generated binary folder and open Samples.sln to build the solution. 

  8. Make sure only one sample is visible from the Visual Studio developer interfaces. 

 

You may also refer here.

 

 

Sincerely,

Iffa

Iffa_Intel
Moderator
247 Views

Greetings,


Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question. 



Sincerely,

Iffa


Reply