[DOCS] legacy adjustments pass 1 (#19787)

This commit is contained in:
Karol Blaszczak 2023-09-13 11:20:25 +02:00 committed by GitHub
parent 1f0c98ed8c
commit dcbfbf8411
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 22 deletions

View File

@ -13,7 +13,6 @@
Supported_Model_Formats Supported_Model_Formats
openvino_docs_OV_Converter_UG_Conversion_Options openvino_docs_OV_Converter_UG_Conversion_Options
openvino_docs_OV_Converter_UG_prepare_model_convert_model_Converting_Model openvino_docs_OV_Converter_UG_prepare_model_convert_model_Converting_Model
openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition
Every deep learning workflow begins with obtaining a model. You can choose to prepare a custom one, use a ready-made solution and adjust it to your needs, or even download and run a pre-trained network from an online database, such as `TensorFlow Hub <https://tfhub.dev/>`__, `Hugging Face <https://huggingface.co/>`__, or `Torchvision models <https://pytorch.org/hub/>`__. Every deep learning workflow begins with obtaining a model. You can choose to prepare a custom one, use a ready-made solution and adjust it to your needs, or even download and run a pre-trained network from an online database, such as `TensorFlow Hub <https://tfhub.dev/>`__, `Hugging Face <https://huggingface.co/>`__, or `Torchvision models <https://pytorch.org/hub/>`__.
@ -21,16 +20,18 @@ Every deep learning workflow begins with obtaining a model. You can choose to pr
OpenVINO™ :doc:`supports several model formats <Supported_Model_Formats>` and can convert them into its own representation, `openvino.Model <api/ie_python_api/_autosummary/openvino.Model.html>`__ (`ov.Model <api/ie_python_api/_autosummary/openvino.runtime.Model.html>`__), providing a conversion API. Converted models can be used for inference with one or multiple OpenVINO Hardware plugins. There are two ways to use the conversion API: using a Python program or calling the ``ovc`` command line tool. OpenVINO™ :doc:`supports several model formats <Supported_Model_Formats>` and can convert them into its own representation, `openvino.Model <api/ie_python_api/_autosummary/openvino.Model.html>`__ (`ov.Model <api/ie_python_api/_autosummary/openvino.runtime.Model.html>`__), providing a conversion API. Converted models can be used for inference with one or multiple OpenVINO Hardware plugins. There are two ways to use the conversion API: using a Python program or calling the ``ovc`` command line tool.
.. note:: .. note::
Prior to OpenVINO 2023.1, model conversion API was exposed as the ``openvino.tools.mo.convert_model``
function and the ``mo`` command line tool. Now, a new and simplified API is used: the
``openvino.convert_model`` function and the ``ovc`` command line tool.
Prior OpenVINO 2023.1 release, model conversion API was exposed as ``openvino.tools.mo.convert_model`` function and ``mo`` command line tool. All new projects are recommended to use the new tools, keeping in mind that they are not fully
Starting from 2023.1 release, a new simplified API was introduced: ``openvino.convert_model`` function and ``ovc`` command line tool as a replacement for ``openvino.tools.mo.convert_model`` backwards compatible. For more details, consult the :doc:`Model Conversion API Transition Guide <openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition>`.
and ``mo`` correspondingly, which are considered to be legacy now. All new users are recommended to use these new methods instead of the old methods. Please note that the new API and old API do not
provide the same level of features, that means the new tools are not always backward compatible with the old ones. Please consult with :doc:`Model Conversion API Transition Guide <openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition>`.
Convert a Model in Python: ``convert_model`` Convert a Model in Python: ``convert_model``
############################################ ##############################################
You can use Model conversion API in Python with the ``openvino.convert_model`` function. This function converts a model from its original framework representation, for example Pytorch or TensorFlow, to the object of type ``openvino.Model``. The resulting ``openvino.Model`` can be inferred in the same application (Python script or Jupyter Notebook) or saved into a file using``openvino.save_model`` for future use. Below, there are examples on how to use the ``openvino.convert_model`` with models from popular public repositories: You can use the Model conversion API in Python with the ``openvino.convert_model`` function. This function converts a model from its original framework representation, for example Pytorch or TensorFlow, to the object of type ``openvino.Model``. The resulting ``openvino.Model`` can be inferred in the same application (Python script or Jupyter Notebook) or saved into a file using``openvino.save_model`` for future use. Below, there are examples of how to use the ``openvino.convert_model`` with models from popular public repositories:
.. tab-set:: .. tab-set::
@ -188,7 +189,7 @@ Option 2, where ``openvino.compile_model`` is used, provides a convenient way to
Option 1 separates model conversion and model inference into two different applications. This approach is useful for deployment scenarios requiring fewer extra dependencies and faster model loading in the end inference application. Option 1 separates model conversion and model inference into two different applications. This approach is useful for deployment scenarios requiring fewer extra dependencies and faster model loading in the end inference application.
For example, converting a PyTorch model to OpenVINO usually demands the ``torch`` Python module and Python. This process can take extra time and memory. But, after the converted model is saved as IR with ``openvino.save_model``, it can be loaded in a separate application without requiring the ``torch`` dependency and the time-consuming conversion. The inference application can be written in other languages supported by OpenVINO, for example, in C++, and Python installation is not necessary for it to run. For example, converting a PyTorch model to OpenVINO usually demands the ``torch`` Python module and Python. This process can take extra time and memory. But, after the converted model is saved as OpenVINO IR with ``openvino.save_model``, it can be loaded in a separate application without requiring the ``torch`` dependency and the time-consuming conversion. The inference application can be written in other languages supported by OpenVINO, for example, in C++, and Python installation is not necessary for it to run.
Before saving the model to OpenVINO IR, consider applying :doc:`Post-training Optimization <ptq_introduction>` to enable more efficient inference and smaller model size. Before saving the model to OpenVINO IR, consider applying :doc:`Post-training Optimization <ptq_introduction>` to enable more efficient inference and smaller model size.
@ -232,4 +233,10 @@ If you are using legacy conversion API (``mo`` or ``openvino.tools.mo.convert_mo
* :doc:`Transition from legacy mo and ov.tools.mo.convert_model <openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition>` * :doc:`Transition from legacy mo and ov.tools.mo.convert_model <openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition>`
* :doc:`Legacy Model Conversion API <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` * :doc:`Legacy Model Conversion API <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>`
.. api/ie_python_api/_autosummary/openvino.Model.html is a broken link for some reason - need to investigate python api article generation
@endsphinxdirective @endsphinxdirective

View File

@ -7,6 +7,7 @@
:hidden: :hidden:
OpenVINO Development Tools package <openvino_docs_install_guides_install_dev_tools> OpenVINO Development Tools package <openvino_docs_install_guides_install_dev_tools>
Model Optimizer / Conversion API <openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition>
OpenVINO API 2.0 transition <openvino_2_0_transition_guide> OpenVINO API 2.0 transition <openvino_2_0_transition_guide>
Open Model ZOO <model_zoo> Open Model ZOO <model_zoo>
Apache MXNet, Caffe, and Kaldi <mxnet_caffe_kaldi> Apache MXNet, Caffe, and Kaldi <mxnet_caffe_kaldi>
@ -36,16 +37,17 @@ offering.
| :doc:`See how to install Development Tools <openvino_docs_install_guides_install_dev_tools>` | :doc:`See how to install Development Tools <openvino_docs_install_guides_install_dev_tools>`
| **Model Optimizer** | **Model Optimizer / Conversion API**
| *New solution:* Direct model support and OpenVINO Converter (OVC) | *New solution:* Direct model support and OpenVINO Converter (OVC)
| *Old solution:* Model Optimizer discontinuation planned for OpenVINO 2025.0 | *Old solution:* Legacy Conversion API discontinuation planned for OpenVINO 2025.0
| |
| Model Optimizer's role was largely reduced when all major model frameworks became | The role of Model Optimizer and later the Conversion API was largely reduced
supported directly. For the sole purpose of converting model files explicitly, when all major model frameworks became supported directly. For converting model
it has been replaced with a more light-weight and efficient solution, the files explicitly, it has been replaced with a more light-weight and efficient
OpenVINO Converter (launched with OpenVINO 2023.1). solution, the OpenVINO Converter (launched with OpenVINO 2023.1).
.. :doc:`See how to use OVC <?????????>` | :doc:`See how to use OVC <openvino_docs_model_processing_introduction>`
| :doc:`See how to transition from the legacy solution <openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition>`
| **Open Model ZOO** | **Open Model ZOO**

View File

@ -22,11 +22,6 @@
openvino_docs_transformations openvino_docs_transformations
OpenVINO Plugin Developer Guide <openvino_docs_ie_plugin_dg_overview> OpenVINO Plugin Developer Guide <openvino_docs_ie_plugin_dg_overview>
.. toctree::
:maxdepth: 1
:hidden:
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer
The Intel® Distribution of OpenVINO™ toolkit supports neural-network models trained with various frameworks, including The Intel® Distribution of OpenVINO™ toolkit supports neural-network models trained with various frameworks, including
TensorFlow, PyTorch, ONNX, TensorFlow Lite, and PaddlePaddle (OpenVINO support for Apache MXNet, Caffe, and Kaldi is currently TensorFlow, PyTorch, ONNX, TensorFlow Lite, and PaddlePaddle (OpenVINO support for Apache MXNet, Caffe, and Kaldi is currently

View File

@ -1,4 +1,4 @@
# [LEGACY] Model Optimizer Extensibility {#openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer} # Legacy Model Optimizer Extensibility {#openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer}
@sphinxdirective @sphinxdirective

View File

@ -10,6 +10,7 @@
:hidden: :hidden:
openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer
In 2023.1 OpenVINO release a new OVC (OpenVINO Model Converter) tool has been introduced with the corresponding Python API: ``openvino.convert_model`` method. ``ovc`` and ``openvino.convert_model`` represent In 2023.1 OpenVINO release a new OVC (OpenVINO Model Converter) tool has been introduced with the corresponding Python API: ``openvino.convert_model`` method. ``ovc`` and ``openvino.convert_model`` represent
a lightweight alternative of ``mo`` and ``openvino.tools.mo.convert_model`` which are considered legacy API now. In this article, all the differences between ``mo`` and ``ovc`` are summarized and the transition guide from the legacy API to the new API is provided. a lightweight alternative of ``mo`` and ``openvino.tools.mo.convert_model`` which are considered legacy API now. In this article, all the differences between ``mo`` and ``ovc`` are summarized and the transition guide from the legacy API to the new API is provided.

View File

@ -14,7 +14,7 @@ OpenVINO 2023.0
.. container:: .. container::
:name: ov-homepage-banner :name: ov-homepage-banner
OpenVINO 2023.0 OpenVINO 2023.1
.. raw:: html .. raw:: html