Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6392 Discussions

AttributeError: 'openvino.inference_engine.ie_api.IENetwork' object has no attribute 'layers'

sigitg
Beginner
877 Views

i have error when run restricted zone notifier python like this:

/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
Traceback (most recent call last):
File "restricted_zone_notifier.py", line 353, in
main()
File "restricted_zone_notifier.py", line 233, in main
n, c, h, w = infer_network.load_model(args.model, TARGET_DEVICE, 1, 1, 2, args.cpu_extension)[1]
File "/home/sigitg/intel-iot/restricted-zone-notifier-python/application/inference.py", line 79, in load_model
[l for l in self.net.layers.keys() if l not in supported_layers]
AttributeError: 'openvino.inference_engine.ie_api.IENetwork' object has no attribute 'layers'

 

Could you please tell me how to resolve this error? Thankyou

0 Kudos
5 Replies
HesamSH
New Contributor I
843 Views
0 Kudos
Wan_Intel
Moderator
823 Views

Hi Sigitg,

Thank you for reaching out to us.


For your information, 'ie_api.IENetwork.layers' is deprecated. The property has been removed in the OpenVINO™ 2021.2. Please refer to here for more details.


For now, there are two options for you:

 

Option 1: Add # at the front of each code from Line 76 to Line 88 in inference.py


Option 2: Use OpenVINO™ 2021.1 for your application.



Regards,

Wan


0 Kudos
sigitg
Beginner
798 Views

Thank you for your reply. I've run your option 1 and its run well. But for option 2, there is no option for download openvino 2021.1 for linux OS.

0 Kudos
Wan_Intel
Moderator
768 Views

Hi Sigitg,


Glad to know that Option 1 works for you.


On another note, thanks for pointing out that OpenVINO™ 2021.1 is not available for download for Linux OS at the moment.


You may use OpenVINO™ 2020.4 for your application.



Regards,

Wan


0 Kudos
Wan_Intel
Moderator
709 Views

Hi Sigitg,


This thread will no longer be monitored since we have provided solutions.

If you need any additional information from Intel, please submit a new question.



Best regards,

Wan


0 Kudos
Reply