Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] MacOS OpenVINO built, what next (and more)? #17766

Closed
Napoleon-BlownApart opened this issue May 28, 2023 · 5 comments
Closed

[Question] MacOS OpenVINO built, what next (and more)? #17766

Napoleon-BlownApart opened this issue May 28, 2023 · 5 comments
Assignees
Labels

Comments

@Napoleon-BlownApart
Copy link

Napoleon-BlownApart commented May 28, 2023

I tried to asked this question in the Intel forum (that is referenced in the documentation), but it mangled my question text and then flagged it as spam. (https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/MacOS-OpenVINO-built-what-next-and-more/m-p/1490656)

[MacBook Pro 2014, MacOS 13.3.1, OpenVINO master, OpenCV 4.7.0]

With an abstract understanding of deep learning and several of it's sub-fields and a NCS2, I now would like to tinker. So, I followed the OpenVINO build instructions for Intel MacOS (master branch) all the way up to step #4, and everything built/installed fine.

With OpenVINO installed on my computer (in /usr/local/OpenVINO) and my NCS2 plugged into my USB port, I believe I have everything needed to start using OpenVINO. Thus I created my working folder with a virtualenv and decided to try the Hello Classification sample.

Looking at the Hello Classification C++ Sample documentation page, it suggests to download the googlenet-v1 model. When I tried to do that, the omz_downloader script was not found. When I looked around my filesystem, I could not find the script in my OpenVINO install location but I did find it in the openvino workspace I cloned from github, under ./build/tools/openvino_dev/build/usr/local/bin/. However, when I run omz_downloader directly from that location, I got an error importlib.metadata.PackageNotFoundError: No package metadata was found for omz-tools.

Prior to the model download step, the Hello Classification C++ Sample documentation page says to install openvino-dev[caffe], but I was reluctant to do this since I had just built everything and, to my mind, already have omz-tools. Whilst composing this question, I decided to try installing pip install openvino-dev anyway (python -m pip install openvino-dev[caffe] returned an error), thinking that maybe it would only download/install this particular part and any other dependencies that are needed. But, to my surprise, pip started installing openvino_dev-2022.3.0-9052-py3-none-any.whl. Sadly, this install failed! So now I seem to have two versions of OpenVINO on my system; the nightly I built and a broken 2022.3.0.

I then attempted to install omz-tools itself, but pip complained:

 pip install omz-tools
 ERROR: Could not find a version that satisfies the requirement omz-tools (from versions: none)
 ERROR: No matching distribution found for omz-tools

So, now I have several questions:

  1. How do I remove all the files that were downloaded as a result of trying to install openvino-dev?
  2. How do I get the omz_downloader that I already have to work? Do I need to install, clone, build anything else?
  3. Could it be that I haven't installed everything I need, e.g. OMZ-Tools and other stuff, since I only did what was stated in the build guide.
@Napoleon-BlownApart Napoleon-BlownApart added bug Something isn't working support_request labels May 28, 2023
@Napoleon-BlownApart
Copy link
Author

Napoleon-BlownApart commented May 28, 2023

In case the error generated by ../openvino/build/tools/openvino_dev/build/usr/local/bin/omz_downloader --name googlenet-v1 is useful in solving my real problem, below is the reported error message:

../openvino/build/tools/openvino_dev/build/usr/local/bin/omz_downloader --name googlenet-v1
Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/metadata/__init__.py", line 563, in from_name
    return next(cls.discover(name=name))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/Programming/Neural_Compute_2/mine/../openvino/build/tools/openvino_dev/build/usr/local/bin/omz_downloader", line 33, in <module>
    sys.exit(load_entry_point('omz-tools==1.0.3', 'console_scripts', 'omz_downloader')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Programming/Neural_Compute_2/mine/../openvino/build/tools/openvino_dev/build/usr/local/bin/omz_downloader", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/metadata/__init__.py", line 981, in distribution
    return Distribution.from_name(distribution_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/metadata/__init__.py", line 565, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for omz-tools

@Napoleon-BlownApart
Copy link
Author

Napoleon-BlownApart commented May 28, 2023

I think I've found a way forward.
I cloned the open_model_zoo repo and found the tools there. I was able to install them by following the instructions:

# Navigate to the open_model_zoo/tools/model_tools directory
pip install --upgrade pip
pip install .

Is this how this was intended?
Shouldn't the OpenVINO build instructions explain this?
Why is omz_download included in the OpenVINO repo given the above?

@Napoleon-BlownApart
Copy link
Author

Looks like I spoke too soon. Whilst the download worked, none of the following steps did:

user@host:[17:23]$ omz_downloader  --name googlenet-v1
################|| Downloading googlenet-v1 ||################

========== Downloading /Users/user/Programming/Neural_Compute_2/mine/public/googlenet-v1/googlenet-v1.prototxt
... 100%, 35 KB, 66657 KB/s, 0 seconds passed

========== Downloading /Users/user/Programming/Neural_Compute_2/mine/public/googlenet-v1/googlenet-v1.caffemodel
... 100%, 52279 KB, 3293 KB/s, 15 seconds passed

========== Replacing text in /Users/user/Programming/Neural_Compute_2/mine/public/googlenet-v1/googlenet-v1.prototxt

[src_customWB]~/Programming/Neural_Compute_2/mine
user@host:[17:25]$ omz_converter --name googlenet-v1
Unable to locate Model Optimizer. Use --mo or run setupvars.sh/setupvars.bat from the OpenVINO toolkit.
[src_customWB]~/Programming/Neural_Compute_2/mine
user@host:[17:26]$ omz_converter --name public/googlenet-v1
No matching models: "public/googlenet-v1"
[src_customWB]~/Programming/Neural_Compute_2/mine
user@host:[17:26]$ omz_converter --name public/googlenet-v1/googlenet-v1.caffemodel
No matching models: "public/googlenet-v1/googlenet-v1.caffemodel"
[src_customWB]~/Programming/Neural_Compute_2/mine
user@host:[17:26]$ omz_converter --name public/googlenet-v1/googlenet-v1.prototxt
No matching models: "public/googlenet-v1/googlenet-v1.prototxt"
[src_customWB]~/Programming/Neural_Compute_2/mine
user@host:[17:27]$ omz_converter --name public/googlenet-v1/googlenet-v1.prototxt.orig
No matching models: "public/googlenet-v1/googlenet-v1.prototxt.orig"
[src_customWB]~/Programming/Neural_Compute_2/mine
user@host:[17:27]$ ../openvino/bin/intel64/Release/hello_classification public/googlenet-v1/ horse.jpg GPU
[ INFO ] Build ................................. 2023.1.0-10999-42ef81a9e6b
[ INFO ]
[ INFO ] Loading model files: public/googlenet-v1/
Check 'false' failed at src/inference/src/core.cpp:100:
[ NETWORK_NOT_READ ] Unable to read the model: public/googlenet-v1/ Please check that model format: public/googlenet-v1/ is supported and the model is correct. Available frontends: paddle tf pytorch tflite ir onnx

[src_customWB]~/Programming/Neural_Compute_2/mine
user@host:[17:30]$ ../openvino/bin/intel64/Release/hello_classification public/googlenet-v1 horse.jpg GPU
[ INFO ] Build ................................. 2023.1.0-10999-42ef81a9e6b
[ INFO ]
[ INFO ] Loading model files: public/googlenet-v1
Check 'false' failed at src/inference/src/core.cpp:100:
[ NETWORK_NOT_READ ] Unable to read the model: public/googlenet-v1 Please check that model format: public/googlenet-v1 is supported and the model is correct. Available frontends: paddle tf pytorch tflite ir onnx

[src_customWB]~/Programming/Neural_Compute_2/mine
user@host:[17:30]$ ../openvino/bin/intel64/Release/hello_classification googlenet-v1 horse.jpg GPU
[ INFO ] Build ................................. 2023.1.0-10999-42ef81a9e6b
[ INFO ]
[ INFO ] Loading model files: googlenet-v1
Check 'false' failed at src/inference/src/core.cpp:100:
[ NETWORK_NOT_READ ] Unable to read the model: googlenet-v1 Please check that model format: googlenet-v1 is supported and the model is correct. Available frontends: paddle tf pytorch tflite ir onnx

[src_customWB]~/Programming/Neural_Compute_2/mine
user@host:[17:30]$

@avitial avitial added category: VPU platform: macOS OpenVINO on macOS and removed bug Something isn't working labels May 30, 2023
@Iffa-Intel
Copy link

Iffa-Intel commented May 31, 2023

Answering your questions:

  1. How do I remove all the files that were downloaded as a result of trying to install openvino-dev?
    The best is not to remove those folders as they are dependencies to make the OV work

  2. How do I get the omz_downloader that I already have to work? Do I need to install, clone, build anything else?

There are 2 steps to obtain the omz_downloader tool:

  1. Could it be that I haven't installed everything I need, e.g. OMZ-Tools and other stuff, since I only did what was stated in the build guide.

Option 1: Install using PyPI and you'll get a working OV with the tools required. You'll need to build OMZ from source afterward, if you need to use OV samples.

Option 2: Install OV from source, compile & build required files. Then, do the same for OMZ. Note that, the omz_downloader tool does not automatically available once you built the OV from src.

This is what I did to install OMZ tool from source

tool1 tool2 tool3

You may refer to this Official Documentation to explore the available ways to get OpenVINO running in your env.

@Iffa-Intel
Copy link

Closing issue, feel free to re-open or start a new issue if additional assistance is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants