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'

aicha
Novice
2,552 Views

Hi Intel,

I am new at using OpenVino and NCS2 .. I am now trying to run the face_recognition_demo that I got from the open model zoo on windows10 .

Iam using version 2020.3 of openvino toolkit. But I get this error everytime i try to do so ( error below). I would be very greatful to you if you help me.

Thank you in advance.

C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo>python face_recognition_demo.py [ INFO ] 2021-03-25 11:28:55,451 Loading models [ INFO ] 2021-03-25 11:28:55,451 Loading the model from 'C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo\models\face-detection-retail-0004\FP16\face-detection-retail-0004.xml' [ INFO ] 2021-03-25 11:28:55,476 Model is loaded [ INFO ] 2021-03-25 11:28:55,476 Loading the model from 'C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo\models\landmarks-regression-retail-0009\FP16\landmarks-regression-retail-0009.xml' [ INFO ] 2021-03-25 11:28:55,492 Model is loaded [ INFO ] 2021-03-25 11:28:55,493 Loading the model from 'C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo\models\face-reidentification-retail-0095\FP16\face-reidentification-retail-0095.xml' [ INFO ] 2021-03-25 11:28:55,562 Model is loaded C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo\face_detector.py:52: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. assert len(model.inputs) == 1, "Expected 1 input blob" detector C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo\landmarks_detector.py:44: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. assert len(model.inputs) == 1, "Expected 1 input blob" landmarks C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo\face_identifier.py:45: DeprecationWarning: 'inputs' property of IENetwork class is deprecated. To access DataPtrs user need to use 'input_data' property of InputInfoPtr objects which can be accessed by 'input_info' property. assert len(model.inputs) == 1, "Expected 1 input blob" identifier Traceback (most recent call last): File "face_recognition_demo.py", line 444, in main() File "face_recognition_demo.py", line 439, in main visualizer = Visualizer(args) File "face_recognition_demo.py", line 238, in __init__ self.frame_processor = FrameProcessor(args) File "face_recognition_demo.py", line 150, in __init__ self.face_detector.deploy(args.d_fd, context) File "C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo\ie_module.py", line 75, in deploy self.model, device, self.max_requests) File "C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo\ie_module.py", line 48, in deploy_model self.check_model_support(model, device) File "C:\Program Files (x86)\IntelSWTools\openvino_2021\face_recognition_demo\ie_module.py", line 35, in check_model_support not_supported_layers = [l for l in net.layers.keys() \ AttributeError: 'openvino.inference_engine.ie_api.IENetwork' object has no attribute 'layers'

0 Kudos
1 Solution
IntelSupport
Community Manager
2,500 Views

Hi aicha,

Greetings to you. Did you get the model (face-detection-retail-0004) downloaded from the same version of your OpenVINO? Make sure you are using the model that you downloaded from the same version of your OpenVINO which 2020.3 and run the demo again. I've validated this on my side and everything works well.

Here is the workaround to run the demo:

1. Setup OpenVINO environment.

cd <INSTALL_DIR>\openvino_2020.3.194\deployment_tools\bin

Run setupvars.bat

2.Navigate to the face recognition demo folder

cd <INSTALL_DIR>\openvino_2020.3.194\deployment_tools\open_model_zoo\demos\python_demos\face_recognition_demo

Run pip install -r requirement.txt

3.Run the demo

python./face_recognition_demo.py -m_fd "<INSTALL_DIR>\openvino_2020.3.194\deployment_tools\tools model_downloader\intel\face-detection-retails-0004\FP16\face-detection-retail-0004.xml" -m_lm "<INSTALL_DIR>\openvino_2020.3.194\deployment_tools\tools model_downloader\intel\landmarks-regression-retail-0009\FP16\landmarks-regression-retail-0009.xml" -m_reid "<INSTALL_DIR>\openvino_2020.3.194\deployment_tools\tools model_downloader\intel\face-reidentification-retail-0095\FP16\face-reidentification-retail-0095.xml" -i 0 -fg "<IMAGE_DIR>\Pictures\image_name"

 

Check out the Interactive Face Recognition Demo documentation for more details.

 

Regards,

Aznie

 

View solution in original post

5 Replies
IntelSupport
Community Manager
2,526 Views

 

Hi aicha,

Thanks for reaching out.

From your file path, it shows that you are using OpenVINO 2021 version instead of 2020.3. Furthermore, the face recognition demo script is no longer available on the latest release OpenVINO 2021. If you want to run the demo, you should use OpenVINO 2020.3 environment. Firstly, navigate to your OpenVINO 2020.3 installation folder and initialize the environment by following these command:

 

Cd <INSTALL_DIR>\openvino_2020.3.194\bin

Setupvars.bat

Then, cd <INSTALL_DIR>\openvino_2020.3.194\deployment_tools\open_model_zoo\demos\python_demos\face_recognition_demo

Run face_recognition_demo.py -h to see the flag that needed for this demo.

 

Regards,

Aznie

 

0 Kudos
aicha
Novice
2,517 Views

Hi @IntelSupport,

Thank you for your response.

But the problem is that I get the following error when I use the 2020.3 OpenVino environment:


[ INFO ] 2021-03-29 10:49:07,692 Loading models
[ INFO ] 2021-03-29 10:49:07,693 Loading the model from

'C:\Program Files (x86)\IntelSWTools\openvino_2020.3.194\deployment_tools\open_model_zoo\demos\python_demos\face_recognition_demo\models\face-detection-retail-0004\FP16\face-detection-retail-0004.xml'
Traceback (most recent call last):
File "face_recognition_demo.py", line 444, in <module>
main()
File "face_recognition_demo.py", line 439, in main
visualizer = Visualizer(args)
File "face_recognition_demo.py", line 238, in __init__
self.frame_processor = FrameProcessor(args)
File "face_recognition_demo.py", line 130, in __init__
face_detector_net = self.load_model(args.m_fd)
File "face_recognition_demo.py", line 175, in load_model
model = self.context.ie_core.read_network(model_path, model_weights_path)
File "ie_api.pyx", line 136, in openvino.inference_engine.ie_api.IECore.read_network
File "ie_api.pyx", line 157, in openvino.inference_engine.ie_api.IECore.read_network
RuntimeError: Cannot create ShapeOf layer fc7_mbox_priorbox/0_port id:192

Thank you in advance.

0 Kudos
IntelSupport
Community Manager
2,501 Views

Hi aicha,

Greetings to you. Did you get the model (face-detection-retail-0004) downloaded from the same version of your OpenVINO? Make sure you are using the model that you downloaded from the same version of your OpenVINO which 2020.3 and run the demo again. I've validated this on my side and everything works well.

Here is the workaround to run the demo:

1. Setup OpenVINO environment.

cd <INSTALL_DIR>\openvino_2020.3.194\deployment_tools\bin

Run setupvars.bat

2.Navigate to the face recognition demo folder

cd <INSTALL_DIR>\openvino_2020.3.194\deployment_tools\open_model_zoo\demos\python_demos\face_recognition_demo

Run pip install -r requirement.txt

3.Run the demo

python./face_recognition_demo.py -m_fd "<INSTALL_DIR>\openvino_2020.3.194\deployment_tools\tools model_downloader\intel\face-detection-retails-0004\FP16\face-detection-retail-0004.xml" -m_lm "<INSTALL_DIR>\openvino_2020.3.194\deployment_tools\tools model_downloader\intel\landmarks-regression-retail-0009\FP16\landmarks-regression-retail-0009.xml" -m_reid "<INSTALL_DIR>\openvino_2020.3.194\deployment_tools\tools model_downloader\intel\face-reidentification-retail-0095\FP16\face-reidentification-retail-0095.xml" -i 0 -fg "<IMAGE_DIR>\Pictures\image_name"

 

Check out the Interactive Face Recognition Demo documentation for more details.

 

Regards,

Aznie

 

aicha
Novice
2,488 Views

Hi Aznie,

Thank you for your help, the demo works for me now.

0 Kudos
IntelSupport
Community Manager
2,473 Views

Hi aicha,

I'm glad to hear that. Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored. 


Regards,

Aznie


0 Kudos
Reply