Skip To Main Content
Support Knowledge Base

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

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

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.

Discontinued Products

Intel® Developer Cloud for the Edge