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

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

sigitg
Beginner
440 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
406 Views

I have actually a similar question posted, would be happy to know the answer.

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/How-to-read-layer-weights-of-an-IR-mod...

Wan_Intel
Moderator
386 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


sigitg
Beginner
361 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.

Wan_Intel
Moderator
331 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


Wan_Intel
Moderator
272 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


Reply