Article ID: 000089329 Content Type: Error Messages Last Reviewed: 05/20/2022

Unable to Read a Network from Intermediate Representation (IR) When Using “cv2.dnn.readnet()”

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Use the “IECore.read_network” method to read a network from IR.

Description
  1. Installed opencv-python-headless and openvino package.
  2. Imported OpenCV* with Python*.
  3. Encountered error when reading a network from IR using cv2.dnn.readNet():
    cv2.error: Build OpenCV with Inference Engine to enable loading models from Model Optimizer. in function 'readFromModelOptimizer'
Resolution

Use ie.read_network() to read a network from IR:

from openvino.inference_engine import IECore

ie = IECore()

net = ie.read_network(“xml_file”, “bin_file”)

Related Products

This article applies to 2 products