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

from openvino.model_zoo.model_api.performance_metrics import PerformanceMetrics

gb8
New Contributor I
1,434 Views

Hi.

I am testing colorization_demo.py from open_model_zoo repo.

cmd : 

python colorization_demo.py -i ~/code/datasets/dish.jpg \

-m public/colorization-v2/FP16/colorization-v2.xml

result :

 

1. error_cmd_line.png

error message is,

Traceback (most recent call last):
File "colorization_demo.py", line 30, in <module>
from images_capture import open_images_capture
File "/home/pi/code/open_model_zoo/demos/common/python/images_capture.py", line 9, in <module>
from openvino.model_zoo.model_api.performance_metrics import PerformanceMetrics
ModuleNotFoundError: No module named 'openvino.model_zoo.model_api'

 

So, I tried to debug the file in the VSCode.

Then error message is  same.

2022-03-29 20_17_41-images_capture.py - pi [WSL_ OV_Ub20] - Visual Studio Code.png

 

For workaround, assign path to 'PerformanceMetrics' to sys.path and modify import statement is working like follows.

sys.path.append('/home/pi/code/notebooks/common/python/openvino/model_zoo/model_api')

from performance_metrics import PerformanceMetrics

 

But this may not be the solution.

My environment is,

  - Windows WSL, Ubuntu 20.04

 

Thanks.

gb8
 

 

 

1 Solution
gb8
New Contributor I
1,231 Views
pip install <omz_dir>/demos/common/py 

solved the problem.

Thanks a lot.

gb8

 

note) 

in the install guide page(https://docs.openvino.ai/latest/omz_demos.html), model_api install guide link you send   seems to be broken.

it leads to https://docs.openvino.ai/latest/common/python/openvino/model_zoo/model_api/README.md#installing-pyth... and 404 message shows.

 

 

View solution in original post

5 Replies
gb8
New Contributor I
1,377 Views
l forgot one more thing. python version is 3.8.
Hairul_Intel
Moderator
1,272 Views

Hi gb8,

Thank you for reaching out to us.

 

I've replicated this issue and received similar results (I've tested with Windows WSL2 Ubuntu 20.04 and Colorization Python Demo).

 

We're investigating this issue and shall get back to you soon.

 

 

Regards,

Hairul


Vladimir_Dudnik
Employee
1,247 Views

@gb8 according to OMZ demos description you need to properly initialize environment to run demos, in particular you need to install OMZ Model API python component (to run python based demos), this can be achieved with simple command:

pip install <omz_dir>/demos/common/python

 

gb8
New Contributor I
1,232 Views
pip install <omz_dir>/demos/common/py 

solved the problem.

Thanks a lot.

gb8

 

note) 

in the install guide page(https://docs.openvino.ai/latest/omz_demos.html), model_api install guide link you send   seems to be broken.

it leads to https://docs.openvino.ai/latest/common/python/openvino/model_zoo/model_api/README.md#installing-pyth... and 404 message shows.

 

 

Hairul_Intel
Moderator
1,206 Views

Hi gb8,

Glad to know that your issue has been resolved.

 

At the moment, the link for the Python Model API Package Installation in the documentation is broken and we have informed the relevant team to reinstate the correct link. Meanwhile, you can follow this Python Model API Package Installation guide on GitHub.

 

This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.

 

 

Regards,

Hairul


Reply