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.
6026 Discussions

NCS2 + Raspberry 3 B Rev 1.2 + Openvino toolkit: ie.read_network(model, xml) doesn't work

ppppp
Novice
1,427 Views

Dear colleagues,

After installing OpenVINO™ toolkit for Raspbian* OS according to this page,
https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_raspbian.ht...

tried to run the following python(ver 3.5.3) code using IR files downloaded from https://download.01.org/opencv/2020/openvinotoolkit/2020.1/open_model_zoo/.

And it gave me the following error


Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'openvino.inference_engine.ie_api.IECore' object has no attribute 'read_network'

 

************* code ************************

import sys
import cv2
from openvino.inference_engine import IENetwork, IEPlugin, IECore

def main():

model_xml='/home/pi/action-recognition-0001-decoder.xml'
model_bin='/home/pi/action-recognition-0001-decoder.bin'
#net = IENetwork(model=model_xml, weights=model_bin)

ie = IECore()
net = ie.read_network(model=model_xml, weights=model_bin)
exec_net = ie.load_network(network=net, device_name="MYRIAD", num_requests=2)
#plugin = IEPlugin(device='CPU', plugin_dirs=None)
#exec_net = plugin.load(network=net, num_requests=1)

input_layer = next(iter(net.input_info))
model_n, model_c, model_h, model_w = net.input_info[input_layer].input_data.shape
print(net.input_info)
out_blob = next(iter(net.outputs)) #out_blob = 'detection_out'
print(model_n, model_c, model_h, model_w)

del net


if __name__ == "__main__":
main()

**********************************************

The specification environment is as follows

Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.13 (stretch)
Release: 9.13
Codename: stretch
l_openvino_toolkit_runtime_raspbian_p_2020.1.023


Thanks in advance for your support!

Regards,
PPPP

0 Kudos
1 Solution
David_C_Intel
Employee
1,339 Views

Hi ppppp,

Thank you for the information provided. Please, try to update to the latest OpenVINO toolkit™ version. Also, make sure to use the Open Model Zoo pre-trained models from the latest version too, as the previous ones are not compatible.


Additionally, you should use IECore only instead of IEPlugin, as it has been deprecated on the latest release. The load_network and read_network functions should work, please let us know if there is still an error while running your code.


Best regards,

David C.


View solution in original post

5 Replies
David_C_Intel
Employee
1,374 Views

Hi ppppp,

Thanks for reaching out. It might be due to an incompatibility with the latest IR versions and OpenVINO™ toolkit for Raspbian. Please try to use the 2019 R3 version models.

Let us know if the issue persists.

Regards,

David C.


ppppp
Novice
1,346 Views

Dear David,

Thank you for answering my question.

I tried to use 2019 R3 version models, so  the following lines were executed succesfully.

exec_net = ie.load_network(network=net, device_name="MYRIAD", num_requests=2)

But the following code failed.

    exec_net = ie.load_network(network=net, device_name="MYRIAD", num_requests=2)

The error message is as follows

 Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'openvino.inference_engine.ie_api.IENetwork' object has no attribute 'input_info'

And I tried   this code     net.inout_info , but   I got the same error message.

Sincerely,

PPPPP

David_C_Intel
Employee
1,340 Views

Hi ppppp,

Thank you for the information provided. Please, try to update to the latest OpenVINO toolkit™ version. Also, make sure to use the Open Model Zoo pre-trained models from the latest version too, as the previous ones are not compatible.


Additionally, you should use IECore only instead of IEPlugin, as it has been deprecated on the latest release. The load_network and read_network functions should work, please let us know if there is still an error while running your code.


Best regards,

David C.


David_C_Intel
Employee
1,303 Views

Hi ppppp,

If you need additional information, please post a new thread, as this discussion will no longer be monitored.

Regards,

David C.


ppppp
Novice
1,285 Views

Dear David,

Thank you for answering my additional question.

Sorry for sending you a reply.

I'm sorry, but I've been busy and haven't implemented your suggestion yet. I will get back to you as soon as I know the results.

Sincerely,

PPPPP

Reply