Article ID: 000060171 Content Type: Troubleshooting Last Reviewed: 05/20/2022

Unable to Read Network When Using OpenVINO™ C API in Visual Studio* (VS)

Environment

Visual Studio 2019

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Steps to properly link OpenVINO with Visual Studio (VS) and correctly format the "ie_infer_request_set_blob" function

Description
  1. Loaded an Intermediate Representation (IR) using OpenVINO C API by referring to Hello Classification C Sample.
  2. Received status as -1 (General Error) when using ie_infer_request_set_blob function.
Resolution

The issue is related to the MKLDNN plugin which usually happens when the OpenVINO environment is not set up properly. Automate the OpenVINO setupvars.bat by creating a batch file as follow:

  1. Write the script below in the .bat  file:

    @echo on
    cd <OpenVINO location>\bin
    CALL setupvars.bat
    cd <Microsoft Visual Studio location>\2019\Community\Common7\IDE
    CALL devenv.exe

     
  2. Run the .bat  file as administrator
  3. After the VS2019 opens, select Hello Query Device Python Sample from OpenVINO folder
  4. Create backup file if necessary
  5. Set Hello Query Device Python Sample as startup item
  6. Run the sample application

Use these suggested method as written in Inference Engine C* API:

  • IEStatusCode ie_infer_request_set_blob(ie_infer_request_t *infer_request, ie_blob_t *blob)
    • Description: Sets the blob in a inference request.
  • Parameters:
    • infer_request : A pointer to ie_infer_request_t instance.
    • blob: A pointer to ie_blob_t instance.
  • Return value: Status code of the operation: OK(0) for success.

Related Products

This article applies to 2 products