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

Convert Tensorflow 2.5 model ( ssd_mobilenet_v2_fpnlite) to open vino IR on mac os big sur

kamegbor
Beginner
1,363 Views

I currently have a mac os big sur with a trained  custom tensorflow model using the tutorial here.  I have been having trouble converting my tensorflow ssd_mobilenet_v2_fpnlite to an openvino IR with the following tutorials ; tutorial 1tutorial 2  . 

 

I am not sure if this is due to the fact that i am do not have a compatible mac os. Anu suggestions would help. Thanks

 

0 Kudos
7 Replies
Syamimi_Intel
Moderator
1,332 Views

Hi kely amegbor,

Thank you for reaching out. Could you share more information about your model?

What is the command that you use to convert the ssd_mobilenet_v2_fpnlite model to Intermediate Representation (IR)?

 

Currently, OpenVINO 2021.3.185 for MacOS has not been officially validated for MacOS 11 and Python 3.8. For more information, you can refer to the macOS Software Requirements.

 

Also, please ensure that you meet all the System requirements of TensorFlow 2:

  • Python 3.6–3.9
  • Python 3.9 support requires TensorFlow 2.5 or later.
  • Python 3.8 support requires TensorFlow 2.2 or later.
  • pip 19.0 or later (requires manylinux2010 support)
  • Ubuntu 16.04 or later (64-bit)
  • macOS 10.12.6 (Sierra) or later (64-bit) (no GPU support)
  • macOS requires pip 20.3 or later
  • Windows 7 or later (64-bit)
  • Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019
  • GPU support requires a CUDA®-enabled card (Ubuntu and Windows)

 

However, you can have a try to convert the ssd_mobilenet_v2_fpnlite model use the following command:

 

python mo_tf.py --saved_model_dir "<Install_Dir>\openvino_2021.3.394\ssd_mobilenet_v2_fpnlite_640x640\saved_model" --transformations_config="<Install_Dir>\openvino_2021.3.394\deployment_tools\model_optimizer\extensions\front\tf\ssd_support_api_v2.0.json" --tensorflow_object_detection_api_pipeline_config="<Install_Dir>\openvino_2021.3.394\ssd_mobilenet_v2_fpnlite_640x640\pipeline.config"

 


 

Regards,

Syamimi


0 Kudos
kamegbor
Beginner
1,321 Views

Syamimi, 

 

Thanks for getting back to me. Some quick info on the model i am using. 

System information (version)

First i started with creating my own data set and converting my images a tf record files from tensorflow and trained them with the pre trained model from ssd_mobilenet_v2_fpnlite. This then gave me the Saved_model.pb file as an output from my training which i am trying to comvert to an IR file with openvino. The end goal is for me to use this model for a computer vision project which i need this file format for. 

 

I have used the provided command to convert my model and always end up with the following message: 

from ngraph.frontend import InputModel  # pylint: disable=no-name-in-module,import-error

ImportError: cannot import name 'InputModel' from 'ngraph.frontend' (unknown location)

 

I have looked for the InputModel module in the ngraph.frontend module but i cannot find it either.Seems like there is a missing file that the mo.py script is referencing to. Not sure if this is expected due to my incompatible os. please let me know. Thanks.

 

0 Kudos
Syamimi_Intel
Moderator
1,306 Views

Hi kely amegbor,

Thank you for waiting. What is your Python version?

For your information, only Python 3.6 - 3.7 are supported for the OpenVINO™ toolkit for macOS.

 

Could you please have a try to convert the ssd_mobilenet_v2_fpnlite model use OpenVINO 2021.3?

Because TensorFlow 2.5 is not compatible with OpenVINO 2020.3 and older versions. TensorFlow 2.X started to release on OpenVINO 2020.4.

Refer to the Release Notes for Intel® Distribution of OpenVINO™ Toolkit 2020 for more information.

 

 

Regards,

Syamimi


0 Kudos
kamegbor
Beginner
1,289 Views

i am using python3.7 in a virtual environment for openvino. My tensorflow model was generated using python3.8. Replicating the steps above gives me the following error: 

Model Optimizer arguments:

Common parameters:

- Path to the Input Model: None

- Path for generated IR: /Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/.

- IR output name: saved_model

- Log level: ERROR

- Batch: Not specified, inherited from the model

- Input layers: Not specified, inherited from the model

- Output layers: Not specified, inherited from the model

- Input shapes: Not specified, inherited from the model

- Mean values: Not specified

- Scale values: Not specified

- Scale factor: Not specified

- Precision of IR: FP32

- Enable fusing: True

- Enable grouped convolutions fusing: True

- Move mean values to preprocess section: None

- Reverse input channels: False

TensorFlow specific parameters:

- Input model in text protobuf format: False

- Path to model dump for TensorBoard: None

- List of shared libraries with TensorFlow custom layers implementation: None

- Update the configuration file with input/output node names: None

- Use configuration file used to generate the model with Object Detection API: /Users/kamegbor/Documents/Apps/Siu/Tensorflow/tensorflow/workspace/training_demo/exported-models/my_model/pipeline.config

- Use the config file: None

[ WARNING ] Could not find the Inference Engine Python API. At this moment, the Inference Engine dependency is not required, but will be required in future releases.

[ WARNING ] Consider building the Inference Engine Python API from sources or try to install OpenVINO (TM) Toolkit using "install_prerequisites.sh"

fatal: not a git repository (or any of the parent directories): .git

Model Optimizer version: unknown version

[ ERROR ]  -------------------------------------------------

[ ERROR ]  ----------------- INTERNAL ERROR ----------------

[ ERROR ]  Unexpected exception happened.

[ ERROR ]  Please contact Model Optimizer developers and forward the following information:

[ ERROR ]  Exception occurred during running replacer "ObjectDetectionAPIOutputReplacement (<class 'extensions.front.tf.ObjectDetectionAPI.ObjectDetectionAPIOutputReplacement'>)": 'inputs'

[ ERROR ]  Traceback (most recent call last):

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/utils/class_registration.py", line 290, in apply_transform

    for_graph_and_each_sub_graph_recursively(graph, replacer.find_and_replace_pattern)

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/middle/pattern_match.py", line 60, in for_graph_and_each_sub_graph_recursively

    for_each_sub_graph_recursively(graph, func)

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/middle/pattern_match.py", line 54, in for_each_sub_graph_recursively

    for_each_sub_graph(graph, recursive_helper)

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/middle/pattern_match.py", line 39, in for_each_sub_graph

    func(node[sub_graph_name])

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/middle/pattern_match.py", line 50, in recursive_helper

    func(sub_graph)

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/front/tf/replacement.py", line 48, in find_and_replace_pattern

    self.transform_graph(graph, desc._replacement_desc['custom_attributes'])

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/extensions/front/tf/ObjectDetectionAPI.py", line 1222, in transform_graph

    add_output_ops(graph, _outputs, graph.graph['inputs'])

KeyError: 'inputs'

 

The above exception was the direct cause of the following exception:

 

Traceback (most recent call last):

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/main.py", line 345, in main

    ret_code = driver(argv)

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/main.py", line 309, in driver

    ret_res = emit_ir(prepare_ir(argv), argv)

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/main.py", line 252, in prepare_ir

    graph = unified_pipeline(argv)

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/pipeline/unified.py", line 29, in unified_pipeline

    class_registration.ClassType.BACK_REPLACER

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/utils/class_registration.py", line 340, in apply_replacements

    apply_replacements_list(graph, replacers_order)

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/utils/class_registration.py", line 330, in apply_replacements_list

    num_transforms=len(replacers_order))

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/utils/logger.py", line 124, in wrapper

    function(*args, **kwargs)

  File "/Users/kamegbor/Documents/Apps/Siu/openvino/openvino-2021.3/model-optimizer/mo/utils/class_registration.py", line 318, in apply_transform

    )) from err

Exception: Exception occurred during running replacer "ObjectDetectionAPIOutputReplacement (<class 'extensions.front.tf.ObjectDetectionAPI.ObjectDetectionAPIOutputReplacement'>)": 'inputs'

 

[ ERROR ]  ---------------- END OF BUG REPORT --------------

[ ERROR ]  -------------------------------------------------

0 Kudos
Syamimi_Intel
Moderator
1,266 Views

Hi kely amegbor,

We are currently investigating this issue and will get back to you.

 

 

Regards,

Syamimi

 

0 Kudos
Syamimi_Intel
Moderator
1,252 Views

Hi kely amegbor,

Thank you for waiting. OpenVINO 2021.3.185 has not been officially validated for MacOS 11. Thus, your error is because OpenVINO 2021.3.185 is not compatible with macOS 11. We apology for the inconvenience.

For your information, I have converted the ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8 model on macOS 10.15 used the same command that I have given to you and it works fine.

 

 

Regards,

Syamimi


0 Kudos
Syamimi_Intel
Moderator
1,211 Views

Hi kely amegbor,

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,

Syamimi


0 Kudos
Reply