[DOCS] New file structure for docs (#23094)
- Updated paths in an entire documentation, - updated scripts used in docs building process, - updated docs cmake to handle new scripts.
This commit is contained in:
parent
172272bb36
commit
cb1d570cae
|
|
@ -22,11 +22,13 @@ function(build_docs)
|
|||
|
||||
set(DOCS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(DOCS_SOURCE_DIR "${OpenVINO_SOURCE_DIR}/docs")
|
||||
set(ARTICLES_EN_DIR "${OpenVINO_SOURCE_DIR}/docs/articles_en")
|
||||
set(SCRIPTS_DIR "${DOCS_SOURCE_DIR}/scripts")
|
||||
|
||||
# Preprocessing scripts
|
||||
set(REMOVE_XML_SCRIPT "${SCRIPTS_DIR}/remove_xml.py")
|
||||
set(FILE_HELPER_SCRIPT "${SCRIPTS_DIR}/filehelper.py")
|
||||
set(ARTICLES_HELPER_SCRIPT "${SCRIPTS_DIR}/articles_helper.py")
|
||||
set(COPY_IMAGES_SCRIPT "${SCRIPTS_DIR}/copy_images.py")
|
||||
set(DOXYGEN_MAPPING_SCRIPT "${SCRIPTS_DIR}/create_mapping.py")
|
||||
set(BREATHE_APIDOC_SCRIPT "${SCRIPTS_DIR}/apidoc.py")
|
||||
|
|
@ -38,9 +40,9 @@ function(build_docs)
|
|||
set(SPHINX_OUTPUT "${DOCS_BUILD_DIR}/_build")
|
||||
|
||||
list(APPEND commands COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --green "STARTED preprocessing OpenVINO articles")
|
||||
list(APPEND commands COMMAND ${Python3_EXECUTABLE} ${FILE_HELPER_SCRIPT}
|
||||
list(APPEND commands COMMAND ${Python3_EXECUTABLE} ${ARTICLES_HELPER_SCRIPT}
|
||||
--filetype=rst
|
||||
--input_dir=${OpenVINO_SOURCE_DIR}
|
||||
--input_dir=${ARTICLES_EN_DIR}
|
||||
--output_dir=${SPHINX_SOURCE_DIR}
|
||||
--exclude_dir=${SPHINX_SOURCE_DIR})
|
||||
list(APPEND commands COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --green "FINISHED preprocessing OpenVINO articles")
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ About OpenVINO
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_performance_benchmarks
|
||||
compatibility_and_support
|
||||
system_requirements
|
||||
Release Notes <openvino_release_notes>
|
||||
Additional Resources <resources>
|
||||
about-openvino/performance-benchmarks
|
||||
about-openvino/compatibility-and-support
|
||||
about-openvino/system-requirements
|
||||
Release Notes <about-openvino/release-notes-openvino>
|
||||
Additional Resources <about-openvino/additional-resources>
|
||||
|
||||
OpenVINO is a toolkit for simple and efficient deployment of various deep learning models.
|
||||
In this section you will find information on the product itself, as well as the software
|
||||
|
|
@ -26,21 +26,21 @@ Features
|
|||
|
||||
One of the main purposes of OpenVINO is to streamline the deployment of deep learning models in user applications. It optimizes and accelerates model inference, which is crucial for such domains as Generative AI, Large Language models, and use cases like object detection, classification, segmentation, and many others.
|
||||
|
||||
* :doc:`Model Optimization <openvino_docs_model_optimization_guide>`
|
||||
* :doc:`Model Optimization <openvino-workflow/model-optimization>`
|
||||
|
||||
OpenVINO provides multiple optimization methods for both the training and post-training stages, including weight compression for Large Language models and Intel Optimum integration with Hugging Face.
|
||||
|
||||
* :doc:`Model Conversion and Framework Compatibility <openvino_docs_model_processing_introduction>`
|
||||
* :doc:`Model Conversion and Framework Compatibility <openvino-workflow/model-preparation>`
|
||||
|
||||
Supported models can be loaded directly or converted to the OpenVINO format to achieve better performance. Supported frameworks include ONNX, PyTorch, TensorFlow, TensorFlow Lite, Keras, and PaddlePaddle.
|
||||
|
||||
* :doc:`Model Inference <openvino_docs_OV_UG_OV_Runtime_User_Guide>`
|
||||
* :doc:`Model Inference <openvino-workflow/running-inference>`
|
||||
|
||||
OpenVINO accelerates deep learning models on various hardware platforms, ensuring real-time, efficient inference.
|
||||
|
||||
* `Deployment on a server <https://github.com/openvinotoolkit/model_server>`__
|
||||
|
||||
A model can be deployed either locally using OpenVINO Runtime or on a model server. Runtime is a set of C++ libraries with C and Python bindings providing a common API to deliver inference solutions. The model server enables quick model inference using external resources.
|
||||
A model can be deployed either locally using OpenVINO Runtime or on a model server. Runtime is a set of C++ libraries with C and Python bindings providing a common API to deliver inference solutions. The model server enables quick model inference using external about-openvino/additional-resources.
|
||||
|
||||
Architecture
|
||||
##############################################################
|
||||
|
|
@ -53,10 +53,10 @@ OpenVINO Ecosystem
|
|||
Along with the primary components of model optimization and runtime, the toolkit also includes:
|
||||
|
||||
* `Neural Network Compression Framework (NNCF) <https://github.com/openvinotoolkit/nncf>`__ - a tool for enhanced OpenVINO™ inference to get performance boost with minimal accuracy drop.
|
||||
* :doc:`Openvino Notebooks <tutorials>`- Jupyter Python notebook tutorials, which demonstrate key features of the toolkit.
|
||||
* :doc:`Openvino Notebooks <learn-openvino/interactive-tutorials-python>`- Jupyter Python notebook learn-openvino/interactive-tutorials-python, which demonstrate key features of the toolkit.
|
||||
* `OpenVINO Model Server <https://github.com/openvinotoolkit/model_server>`__ - a server that enables scalability via a serving microservice.
|
||||
* :doc:`OpenVINO Training Extensions <ote_documentation>` – a convenient environment to train Deep Learning models and convert them using the OpenVINO™ toolkit for optimized inference.
|
||||
* :doc:`Dataset Management Framework (Datumaro) <datumaro_documentation>` - a tool to build, transform, and analyze datasets.
|
||||
* :doc:`OpenVINO Training Extensions <documentation/openvino-ecosystem/openvino-training-extensions>` – a convenient environment to train Deep Learning models and convert them using the OpenVINO™ toolkit for optimized inference.
|
||||
* :doc:`Dataset Management Framework (Datumaro) <documentation/openvino-ecosystem/datumaro>` - a tool to build, transform, and analyze datasets.
|
||||
|
||||
Community
|
||||
##############################################################
|
||||
|
|
@ -66,7 +66,7 @@ OpenVINO community plays a vital role in the growth and development of the open-
|
|||
* `OpenVINO GitHub issues, discussions and pull requests <https://github.com/openvinotoolkit/openvino>`__
|
||||
* `OpenVINO Blog <https://blog.openvino.ai/>`__
|
||||
* `Community Forum <https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/bd-p/distribution-openvino-toolkit>`__
|
||||
* `OpenVINO video tutorials <https://www.youtube.com/watch?v=_Jnjt21ZDS8&list=PLg-UKERBljNxdIQir1wrirZJ50yTp4eHv>`__
|
||||
* `OpenVINO video learn-openvino/interactive-tutorials-python <https://www.youtube.com/watch?v=_Jnjt21ZDS8&list=PLg-UKERBljNxdIQir1wrirZJ50yTp4eHv>`__
|
||||
* `Support Information <https://www.intel.com/content/www/us/en/support/products/96066/software/development-software/openvino-toolkit.html>`__
|
||||
|
||||
Case Studies
|
||||
|
|
|
|||
|
|
@ -13,19 +13,19 @@ Additional Resources
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_OV_Glossary
|
||||
openvino_docs_Legal_Information
|
||||
openvino_docs_telemetry_information
|
||||
additional-resources/glossary
|
||||
additional-resources/legal-information
|
||||
additional-resources/telemetry
|
||||
Case Studies <https://www.intel.com/openvino-success-stories>
|
||||
|
||||
|
||||
:doc:`Performance Benchmarks <openvino_docs_performance_benchmarks>` contain results from benchmarking models with OpenVINO on Intel hardware.
|
||||
:doc:`Performance Benchmarks <performance-benchmarks>` contain results from benchmarking models with OpenVINO on Intel hardware.
|
||||
|
||||
:doc:`Glossary <openvino_docs_OV_Glossary>` contains terms used in OpenVINO.
|
||||
:doc:`Glossary <additional-resources/glossary>` contains terms used in OpenVINO.
|
||||
|
||||
:doc:`Legal Information <openvino_docs_Legal_Information>` has trademark information and other legal statements.
|
||||
:doc:`Legal Information <additional-resources/legal-information>` has trademark information and other legal statements.
|
||||
|
||||
:doc:`OpenVINO™ Telemetry <openvino_docs_telemetry_information>` has detailed information on the telemetry data collection.
|
||||
:doc:`OpenVINO™ Telemetry <additional-resources/telemetry>` has detailed information on the telemetry data collection.
|
||||
|
||||
`Case Studies <https://www.intel.com/openvino-success-stories>`__ are articles about real-world examples of OpenVINO™ usage.
|
||||
|
||||
|
|
|
|||
|
|
@ -115,11 +115,11 @@ Glossary of terms used in OpenVINO™
|
|||
|
||||
| *plugin / Inference Device / Inference Mode*
|
||||
| OpenVINO makes hardware available for inference based on several core components.
|
||||
They used to be called "plugins" in earlier versions of documentation and you may
|
||||
They used to be called "plugins" in earlier versions of ../../documentation and you may
|
||||
still find this term in some articles. Because of their role in the software,
|
||||
they are now referred to as Devices and Modes ("virtual" devices). For a detailed
|
||||
description of the concept, refer to
|
||||
:doc:`Inference Devices and Modes <openvino_docs_Runtime_Inference_Modes_Overview>`.
|
||||
:doc:`Inference Devices and Modes <../../openvino-workflow/running-inference/inference-devices-and-modes>`.
|
||||
|
||||
| *Tensor*
|
||||
| A memory container used for storing inputs and outputs of the model, as well as
|
||||
|
|
@ -128,4 +128,4 @@ Glossary of terms used in OpenVINO™
|
|||
|
||||
See Also
|
||||
#################################################
|
||||
* :doc:`Available Operations Sets <openvino_docs_ops_opset>`
|
||||
* :doc:`Available Operations Sets <../../documentation/openvino-ir-format/operation-sets/available-opsets>`
|
||||
|
|
|
|||
|
|
@ -8,19 +8,19 @@ Compatibility and Support
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_supported_models
|
||||
openvino_supported_devices
|
||||
openvino_resources_supported_operations
|
||||
openvino_resources_supported_operations_frontend
|
||||
compatibility-and-support/supported-models
|
||||
compatibility-and-support/supported-devices
|
||||
compatibility-and-support/supported-operations-inference-devices
|
||||
compatibility-and-support/supported-operations-framework-frontend
|
||||
|
||||
|
||||
:doc:`Supported Devices <openvino_supported_devices>` - compatibility information for supported hardware accelerators.
|
||||
:doc:`Supported Devices <compatibility-and-support/supported-devices>` - compatibility information for supported hardware accelerators.
|
||||
|
||||
:doc:`Supported Models <openvino_supported_models>` - a table of models officially supported by OpenVINO.
|
||||
:doc:`Supported Models <compatibility-and-support/supported-models>` - a table of models officially supported by OpenVINO.
|
||||
|
||||
:doc:`Supported Operations <openvino_resources_supported_operations>` - a listing of framework layers supported by OpenVINO.
|
||||
:doc:`Supported Operations <compatibility-and-support/supported-operations-inference-devices>` - a listing of framework layers supported by OpenVINO.
|
||||
|
||||
:doc:`Supported Operations <openvino_resources_supported_operations_frontend>` - a listing of layers supported by OpenVINO inference devices.
|
||||
:doc:`Supported Operations <compatibility-and-support/supported-operations-framework-frontend>` - a listing of layers supported by OpenVINO inference devices.
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,24 +11,24 @@ Inference Device Support
|
|||
|
||||
The OpenVINO™ runtime enables you to use a selection of devices to run your
|
||||
deep learning models:
|
||||
:doc:`CPU <openvino_docs_OV_UG_supported_plugins_CPU>`,
|
||||
:doc:`GPU <openvino_docs_OV_UG_supported_plugins_GPU>`,
|
||||
:doc:`NPU <openvino_docs_OV_UG_supported_plugins_NPU>`.
|
||||
:doc:`CPU <../../openvino-workflow/running-inference/inference-devices-and-modes/cpu-device>`,
|
||||
:doc:`GPU <../../openvino-workflow/running-inference/inference-devices-and-modes/gpu-device>`,
|
||||
:doc:`NPU <../../openvino-workflow/running-inference/inference-devices-and-modes/npu-device>`.
|
||||
|
||||
| For their usage guides, see :doc:`Devices and Modes <openvino_docs_Runtime_Inference_Modes_Overview>`.
|
||||
| For a detailed list of devices, see :doc:`System Requirements <system_requirements>`.
|
||||
| For their usage guides, see :doc:`Devices and Modes <../../openvino-workflow/running-inference/inference-devices-and-modes>`.
|
||||
| For a detailed list of devices, see :doc:`System Requirements <../system-requirements>`.
|
||||
|
||||
Beside running inference with a specific device,
|
||||
OpenVINO offers the option of running automated inference with the following inference modes:
|
||||
|
||||
* :doc:`Automatic Device Selection <openvino_docs_OV_UG_supported_plugins_AUTO>` - automatically selects the best device
|
||||
* :doc:`Automatic Device Selection <../../openvino-workflow/running-inference/inference-devices-and-modes/auto-device-selection>` - automatically selects the best device
|
||||
available for the given task. It offers many additional options and optimizations, including inference on
|
||||
multiple devices at the same time.
|
||||
* :doc:`Heterogeneous Inference <openvino_docs_OV_UG_Hetero_execution>` - enables splitting inference among several devices
|
||||
* :doc:`Heterogeneous Inference <../../openvino-workflow/running-inference/inference-devices-and-modes/hetero-execution>` - enables splitting inference among several devices
|
||||
automatically, for example, if one device doesn't support certain operations.
|
||||
* :doc:`Multi-device Inference <openvino_docs_OV_UG_Running_on_multiple_devices>` - executes inference on multiple devices.
|
||||
* :doc:`Multi-device Inference <../../openvino-workflow/running-inference/inference-devices-and-modes/multi-device>` - executes inference on multiple devices.
|
||||
Currently, this mode is considered a legacy solution. Using Automatic Device Selection is advised.
|
||||
* :doc:`Automatic Batching <openvino_docs_OV_UG_Automatic_Batching>` - automatically groups inference requests to improve
|
||||
* :doc:`Automatic Batching <../../openvino-workflow/running-inference/inference-devices-and-modes/automatic-batching>` - automatically groups inference requests to improve
|
||||
device utilization.
|
||||
|
||||
|
||||
|
|
@ -36,20 +36,20 @@ OpenVINO offers the option of running automated inference with the following inf
|
|||
Feature Support and API Coverage
|
||||
#################################
|
||||
|
||||
================================================================================== ======= ========== ===========
|
||||
Supported Feature CPU GPU NPU
|
||||
================================================================================== ======= ========== ===========
|
||||
:doc:`Heterogeneous execution <openvino_docs_OV_UG_Hetero_execution>` Yes Yes No
|
||||
:doc:`Multi-device execution <openvino_docs_OV_UG_Running_on_multiple_devices>` Yes Yes Partial
|
||||
:doc:`Automatic batching <openvino_docs_OV_UG_Automatic_Batching>` No Yes No
|
||||
:doc:`Multi-stream execution <openvino_docs_deployment_optimization_guide_tput>` Yes Yes No
|
||||
:doc:`Models caching <openvino_docs_OV_UG_Model_caching_overview>` Yes Partial Yes
|
||||
:doc:`Dynamic shapes <openvino_docs_OV_UG_DynamicShapes>` Yes Partial No
|
||||
:doc:`Import/Export <openvino_ecosystem>` Yes No Yes
|
||||
:doc:`Preprocessing acceleration <openvino_docs_OV_UG_Preprocessing_Overview>` Yes Yes No
|
||||
:doc:`Stateful models <openvino_docs_OV_UG_stateful_models_intro>` Yes No Yes
|
||||
:doc:`Extensibility <openvino_docs_Extensibility_UG_Intro>` Yes Yes No
|
||||
================================================================================== ======= ========== ===========
|
||||
=============================================================================================================================== ======= ========== ===========
|
||||
Supported Feature CPU GPU NPU
|
||||
=============================================================================================================================== ======= ========== ===========
|
||||
:doc:`Heterogeneous execution <../../openvino-workflow/running-inference/inference-devices-and-modes/hetero-execution>` Yes Yes No
|
||||
:doc:`Multi-device execution <../../openvino-workflow/running-inference/inference-devices-and-modes/multi-device>` Yes Yes Partial
|
||||
:doc:`Automatic batching <../../openvino-workflow/running-inference/inference-devices-and-modes/automatic-batching>` No Yes No
|
||||
:doc:`Multi-stream execution <../../openvino-workflow/running-inference/optimize-inference/optimizing-throughput>` Yes Yes No
|
||||
:doc:`Models caching <../../openvino-workflow/running-inference/optimize-inference/optimizing-latency/model-caching-overview>` Yes Partial Yes
|
||||
:doc:`Dynamic shapes <../../openvino-workflow/running-inference/dynamic-shapes>` Yes Partial No
|
||||
:doc:`Import/Export <../../documentation/openvino-ecosystem>` Yes No Yes
|
||||
:doc:`Preprocessing acceleration <../../openvino-workflow/running-inference/optimize-inference/optimizie-preprocessing>` Yes Yes No
|
||||
:doc:`Stateful models <../../openvino-workflow/running-inference/stateful-models-intro>` Yes No Yes
|
||||
:doc:`Extensibility <../../documentation/openvino-extensibility>` Yes Yes No
|
||||
=============================================================================================================================== ======= ========== ===========
|
||||
|
||||
|
||||
+-------------------------+-----------+------------------+-------------------+
|
||||
|
|
@ -82,11 +82,11 @@ Devices similar to the ones used for benchmarking can be accessed using
|
|||
`Intel® DevCloud for the Edge <https://devcloud.intel.com/edge/>`__,
|
||||
a remote development environment with access to Intel® hardware and the latest versions
|
||||
of the Intel® Distribution of OpenVINO™ Toolkit.
|
||||
`Learn more <https://devcloud.intel.com/edge/get_started/devcloud/>`__ or
|
||||
`Learn more <https://devcloud.intel.com/edge/../../get-started/devcloud/>`__ or
|
||||
`Register here <https://inteliot.force.com/DevcloudForEdge/s/>`__.
|
||||
|
||||
For setting up a relevant configuration, refer to the
|
||||
:doc:`Integrate with Customer Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`
|
||||
:doc:`Integrate with Customer Application <../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`
|
||||
topic (step 3 "Configure input and output").
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ Based on our research and user feedback, we prioritize the most common models an
|
|||
before every release. These models are considered officially supported.
|
||||
|
||||
|
||||
.. button-link:: _static/download/OV_2023_models_supported.pdf
|
||||
.. button-link:: ../../_static/download/OV_2023_models_supported.pdf
|
||||
:color: primary
|
||||
:outline:
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ The list is based on release 2023.0, as of June 01, 2023
|
|||
|
||||
|
||||
* You can create a GitHub request for the operation(s) that are missing. These requests are reviewed regularly. You will be informed if and how the request will be accommodated. Additionally, your request may trigger a reply from someone in the community who can help.
|
||||
* As OpenVINO™ is open source you can enhance it with your own contribution to the GitHub repository. To learn more, see the articles on :doc:`OpenVINO Extensibility <openvino_docs_Extensibility_UG_Intro>`.
|
||||
* As OpenVINO™ is open source you can enhance it with your own contribution to the GitHub repository. To learn more, see the articles on :doc:`OpenVINO Extensibility <../../documentation/openvino-extensibility>`.
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_resources_supported_operations_frontend}
|
||||
.. {#openvino_../additional-resources_supported_operations_frontend}
|
||||
|
||||
Supported Operations - by Framework Frontend
|
||||
============================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_resources_supported_operations}
|
||||
.. {#openvino_../additional-resources_supported_operations}
|
||||
|
||||
Supported Operations - by Inference Devices
|
||||
===========================================
|
||||
|
|
@ -8,13 +8,13 @@ This page presents operations supported by OpenVINO inference devices. The table
|
|||
for a more detailed and most recent listing of operations that are implemented and tested:
|
||||
|
||||
|
||||
.. button-link:: _static/download/conformance_reports/opset_report_omz_static.html
|
||||
.. button-link:: ../../_static/download/conformance_reports/opset_report_omz_static.html
|
||||
:color: primary
|
||||
:outline:
|
||||
|
||||
See the full conformance report table (static)
|
||||
|
||||
.. button-link:: _static/download/conformance_reports/opset_report_omz_dynamic.html
|
||||
.. button-link:: ../../_static/download/conformance_reports/opset_report_omz_dynamic.html
|
||||
:color: primary
|
||||
:outline:
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ for a more detailed and most recent listing of operations that are implemented a
|
|||
================================= =============== ============== ==================
|
||||
|
||||
| `*` - support is limited to the specific parameters.
|
||||
| `**` - support is implemented via :doc:`Extensibility mechanism <openvino_docs_Extensibility_UG_Intro>`.
|
||||
| `**` - support is implemented via :doc:`Extensibility mechanism <../../documentation/openvino-extensibility>`.
|
||||
| `***` - supports NCDHW layout.
|
||||
| `****` - support is implemented via runtime reference.
|
||||
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ Performance Benchmarks
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_performance_benchmarks_faq
|
||||
OpenVINO Accuracy <openvino_docs_performance_int8_vs_fp32>
|
||||
openvino_docs_MO_DG_Getting_Performance_Numbers
|
||||
performance-benchmarks/performance-benchmarks-faq
|
||||
OpenVINO Accuracy <performance-benchmarks/model-accuracy-int8-fp32>
|
||||
performance-benchmarks/getting-performance-numbers
|
||||
|
||||
|
||||
This page presents benchmark results for `Intel® Distribution of OpenVINO™ toolkit <https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit.html>`__
|
||||
and :doc:`OpenVINO Model Server <ovms_what_is_openvino_model_server>`, for a representative selection of public neural networks and Intel® devices.
|
||||
and :doc:`OpenVINO Model Server <../ovms_what_is_openvino_model_server>`, for a representative selection of public neural networks and Intel® devices.
|
||||
The results may help you decide which hardware to use in your applications or plan AI workload for the hardware you have already implemented in your solutions.
|
||||
Click the buttons below to see the chosen benchmark data.
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ Please visit the tabs below for more information on key performance indicators a
|
|||
|
||||
The workload parameters affect the performance results of the different models we use for benchmarking.
|
||||
Image processing models have different image size definitions and the Natural Language Processing models
|
||||
have different max token list lengths. All these can be found in detail in the :doc:`FAQ section <openvino_docs_performance_benchmarks_faq>`.
|
||||
have different max token list lengths. All these can be found in detail in the :doc:`FAQ section <performance-benchmarks/performance-benchmarks-faq>`.
|
||||
All models are executed using a batch size of 1. Below are the parameters for the GenAI models we display.
|
||||
|
||||
* Input tokens: 1024,
|
||||
|
|
@ -119,21 +119,21 @@ For a listing of all platforms and configurations used for testing, refer to the
|
|||
|
||||
.. grid-item::
|
||||
|
||||
.. button-link:: _static/benchmarks_files/OV-2023.3-platform_list.pdf
|
||||
.. button-link:: ../_static/benchmarks_files/OV-2023.3-platform_list.pdf
|
||||
:color: primary
|
||||
:outline:
|
||||
:expand:
|
||||
|
||||
:material-regular:`download;1.5em` Click for Hardware Platforms [PDF]
|
||||
|
||||
.. button-link:: _static/benchmarks_files/OV-2023.3-system-info-detailed.xlsx
|
||||
.. button-link:: ../_static/benchmarks_files/OV-2023.3-system-info-detailed.xlsx
|
||||
:color: primary
|
||||
:outline:
|
||||
:expand:
|
||||
|
||||
:material-regular:`download;1.5em` Click for Configuration Details [XLSX]
|
||||
|
||||
.. button-link:: _static/benchmarks_files/OV-2023.3-Performance-Data.xlsx
|
||||
.. button-link:: ../_static/benchmarks_files/OV-2023.3-Performance-Data.xlsx
|
||||
:color: primary
|
||||
:outline:
|
||||
:expand:
|
||||
|
|
@ -155,7 +155,7 @@ only to measuring performance.
|
|||
|
||||
The benchmark setup for OVMS consists of four main parts:
|
||||
|
||||
.. image:: _static/images/performance_benchmarks_ovms_02.png
|
||||
.. image:: ../_static/images/performance_benchmarks_ovms_02.png
|
||||
:alt: OVMS Benchmark Setup Diagram
|
||||
|
||||
* **OpenVINO™ Model Server** is launched as a docker container on the server platform and it listens (and answers on)
|
||||
|
|
@ -180,7 +180,7 @@ only to measuring performance.
|
|||
Test performance yourself
|
||||
####################################
|
||||
|
||||
You can also test performance for your system yourself, following the guide on :doc:`getting performance numbers <openvino_docs_MO_DG_Getting_Performance_Numbers>`.
|
||||
You can also test performance for your system yourself, following the guide on :doc:`getting performance numbers <performance-benchmarks/getting-performance-numbers>`.
|
||||
|
||||
Performance of a particular application can also be evaluated virtually using `Intel® DevCloud for the Edge <https://devcloud.intel.com/edge/>`__.
|
||||
It is a remote development environment with access to Intel® hardware and the latest versions of the Intel® Distribution of the OpenVINO™ Toolkit.
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ Test performance with the benchmark_app
|
|||
|
||||
You can run OpenVINO benchmarks in both C++ and Python APIs, yet the experience differs in each case.
|
||||
The Python one is part of OpenVINO Runtime installation, while C++ is available as a code sample.
|
||||
For a detailed description, see: :doc:`benchmark_app <openvino_sample_benchmark_tool>`.
|
||||
For a detailed description, see: :doc:`benchmark_app <../../learn-openvino/openvino-samples/benchmark-tool>`.
|
||||
|
||||
Make sure to install the latest release package with support for frameworks of the models you want to test.
|
||||
For the most reliable performance benchmarks, :doc:`prepare the model for use with OpenVINO <openvino_docs_model_processing_introduction>`.
|
||||
For the most reliable performance benchmarks, :doc:`prepare the model for use with OpenVINO <../../openvino-workflow/model-preparation>`.
|
||||
|
||||
|
||||
Running the benchmark application
|
||||
|
|
@ -32,11 +32,11 @@ The benchmark_app includes a lot of device-specific options, but the primary usa
|
|||
benchmark_app -m <model> -d <device> -i <input>
|
||||
|
||||
|
||||
Each of the :doc:`OpenVINO supported devices <openvino_supported_devices>` offers
|
||||
Each of the :doc:`OpenVINO supported devices <../compatibility-and-support/supported-devices>` offers
|
||||
performance settings that contain command-line equivalents in the Benchmark app.
|
||||
|
||||
While these settings provide really low-level control for the optimal model performance on the *specific* device,
|
||||
it is recommended to always start performance evaluation with the :doc:`OpenVINO High-Level Performance Hints <openvino_docs_OV_UG_Performance_Hints>` first, like so:
|
||||
it is recommended to always start performance evaluation with the :doc:`OpenVINO High-Level Performance Hints <../../openvino-workflow/running-inference/optimize-inference/high-level-performance-hints>` first, like so:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
|
@ -61,8 +61,8 @@ When evaluating performance of a model with OpenVINO Runtime, it is required to
|
|||
.. note::
|
||||
|
||||
Some image pre-processing can be baked into OpenVINO IR and accelerated accordingly. For more information,
|
||||
refer to :doc:`Embedding Pre-processing <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>` and
|
||||
:doc:`General Runtime Optimizations <openvino_docs_deployment_optimization_guide_common>`.
|
||||
refer to :doc:`Embedding Pre-processing <../../documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api/[legacy]-embedding-preprocessing-computation>` and
|
||||
:doc:`General Runtime Optimizations <../../openvino-workflow/running-inference/optimize-inference/general-optimizations>`.
|
||||
|
||||
|
||||
2 - Try to Get Credible Data
|
||||
|
|
@ -85,23 +85,23 @@ slower than the subsequent ones, an aggregated value can be used for the executi
|
|||
|
||||
When comparing the OpenVINO Runtime performance with the framework or another reference code, make sure that both versions are as similar as possible:
|
||||
|
||||
- Wrap the exact inference execution (for examples, see :doc:`Benchmark app <openvino_sample_benchmark_tool>`).
|
||||
- Wrap the exact inference execution (for examples, see :doc:`Benchmark app <../../learn-openvino/openvino-samples/benchmark-tool>`).
|
||||
- Do not include model loading time.
|
||||
- Ensure that the inputs are identical for OpenVINO Runtime and the framework. For example, watch out for random values that can be used to populate the inputs.
|
||||
- In situations when any user-side pre-processing should be tracked separately, consider :doc:`image pre-processing and conversion <openvino_docs_OV_UG_Preprocessing_Overview>`.
|
||||
- When applicable, leverage the :doc:`Dynamic Shapes support <openvino_docs_OV_UG_DynamicShapes>`.
|
||||
- In situations when any user-side pre-processing should be tracked separately, consider :doc:`image pre-processing and conversion <../../openvino-workflow/running-inference/optimize-inference/optimizie-preprocessing>`.
|
||||
- When applicable, leverage the :doc:`Dynamic Shapes support <../../openvino-workflow/running-inference/dynamic-shapes>`.
|
||||
- If possible, demand the same accuracy. For example, TensorFlow allows ``FP16`` execution, so when comparing to that, make sure to test the OpenVINO Runtime with the ``FP16`` as well.
|
||||
|
||||
Internal Inference Performance Counters and Execution Graphs
|
||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
More detailed insights into inference performance breakdown can be achieved with device-specific performance counters and/or execution graphs.
|
||||
Both :doc:`C++ and Python <openvino_sample_benchmark_tool>`
|
||||
Both :doc:`C++ and Python <../../learn-openvino/openvino-samples/benchmark-tool>`
|
||||
versions of the *benchmark_app* support a ``-pc`` command-line parameter that outputs internal execution breakdown.
|
||||
|
||||
For example, the table shown below is part of performance counters for quantized
|
||||
`TensorFlow implementation of ResNet-50 <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf>`__
|
||||
model inference on :doc:`CPU Plugin <openvino_docs_OV_UG_supported_plugins_CPU>`.
|
||||
`TensorFlow implementation of ResNet-50 <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/public/resnet-50-tf>`__
|
||||
model inference on :doc:`CPU Plugin <../../openvino-workflow/running-inference/inference-devices-and-modes/cpu-device>`.
|
||||
Keep in mind that since the device is CPU, the ``realTime`` wall clock and the ``cpu`` time layers are the same.
|
||||
Information about layer precision is also stored in the performance counters.
|
||||
|
||||
|
|
@ -128,21 +128,21 @@ Information about layer precision is also stored in the performance counters.
|
|||
| - The ``FP32`` suffix is for layers computed in 32-bit precision.
|
||||
|
|
||||
| All ``Convolution`` layers are executed in ``int8`` precision. The rest of the layers are fused into Convolutions using post-operation optimization,
|
||||
as described in :doc:`CPU Device <openvino_docs_OV_UG_supported_plugins_CPU>`. This contains layer names
|
||||
as described in :doc:`CPU Device <../../openvino-workflow/running-inference/inference-devices-and-modes/cpu-device>`. This contains layer names
|
||||
(as seen in OpenVINO IR), type of the layer, and execution statistics.
|
||||
|
||||
|
||||
Both *benchmark_app* versions also support the ``exec_graph_path`` command-line option. It requires OpenVINO to output the same execution
|
||||
statistics per layer, but in the form of plugin-specific `Netron-viewable <https://netron.app/>`__ graph to the specified file.
|
||||
|
||||
Especially when performance-debugging the :doc:`latency <openvino_docs_deployment_optimization_guide_latency>`, note that the counters
|
||||
Especially when performance-debugging the :doc:`latency <../../openvino-workflow/running-inference/optimize-inference/optimizing-latency>`, note that the counters
|
||||
do not reflect the time spent in the ``plugin/device/driver/etc`` queues. If the sum of the counters is too different from the latency
|
||||
of an inference request, consider testing with less inference requests. For example, running single
|
||||
:doc:`OpenVINO stream <openvino_docs_deployment_optimization_guide_tput>` with multiple requests would produce nearly identical
|
||||
:doc:`OpenVINO stream <../../openvino-workflow/running-inference/optimize-inference/optimizing-throughput>` with multiple requests would produce nearly identical
|
||||
counters as running a single inference request, while the actual latency can be quite different.
|
||||
|
||||
Lastly, the performance statistics with both performance counters and execution graphs are averaged,
|
||||
so such data for the :doc:`inputs of dynamic shapes <openvino_docs_OV_UG_DynamicShapes>` should be measured carefully,
|
||||
so such data for the :doc:`inputs of dynamic shapes <../../openvino-workflow/running-inference/dynamic-shapes>` should be measured carefully,
|
||||
preferably by isolating the specific shape and executing multiple times in a loop, to gather reliable data.
|
||||
|
||||
Use ITT to Get Performance Insights
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_performance_benchmarks_faq}
|
||||
.. {#../performance-benchmarks_faq}
|
||||
|
||||
Performance Information F.A.Q.
|
||||
==============================
|
||||
|
|
@ -19,7 +19,7 @@ Performance Information F.A.Q.
|
|||
|
||||
.. dropdown:: Where can I find the models used in the performance benchmarks?
|
||||
|
||||
All models used are included in the GitHub repository of :doc:`Open Model Zoo <model_zoo>`.
|
||||
All models used are included in the GitHub repository of :doc:`Open Model Zoo <../../documentation/legacy-features/model-zoo>`.
|
||||
|
||||
.. dropdown:: Will there be any new models added to the list used for benchmarking?
|
||||
|
||||
|
|
@ -31,10 +31,10 @@ Performance Information F.A.Q.
|
|||
|
||||
All of the performance benchmarks are generated using the
|
||||
open-source tool within the Intel® Distribution of OpenVINO™ toolkit
|
||||
called :doc:`benchmark_app <openvino_sample_benchmark_tool>`.
|
||||
called :doc:`benchmark_app <../../learn-openvino/openvino-samples/benchmark-tool>`.
|
||||
This tool is available for Python and C++ apps.
|
||||
|
||||
For a simple instruction on testing performance, see the :doc:`Getting Performance Numbers Guide <openvino_docs_MO_DG_Getting_Performance_Numbers>`.
|
||||
For a simple instruction on testing performance, see the :doc:`Getting Performance Numbers Guide <getting-performance-numbers>`.
|
||||
|
||||
.. dropdown:: Where can I find a more detailed description of the workloads used for benchmarking?
|
||||
|
||||
|
|
@ -69,39 +69,39 @@ Performance Information F.A.Q.
|
|||
- BERT
|
||||
- question / answer
|
||||
- 128
|
||||
* - `bert-large-uncased-whole-word-masking-squad-int8-0001 <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001>`__
|
||||
* - `bert-large-uncased-whole-word-masking-squad-int8-0001 <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/intel/bert-large-uncased-whole-word-masking-squad-int8-0001>`__
|
||||
- BERT-large
|
||||
- question / answer
|
||||
- 384
|
||||
* - `efficientdet-d0 <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/efficientdet-d0-tf>`__
|
||||
* - `efficientdet-d0 <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/public/efficientdet-d0-tf>`__
|
||||
- Efficientdet
|
||||
- classification
|
||||
- 512x512
|
||||
* - `mask_rcnn_resnet50_atrous_coco <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/mask_rcnn_resnet50_atrous_coco>`__
|
||||
* - `mask_rcnn_resnet50_atrous_coco <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/public/mask_rcnn_resnet50_atrous_coco>`__
|
||||
- Mask R-CNN ResNet 50 Atrous
|
||||
- object instance segmentation
|
||||
- 800x1365
|
||||
* - `mobilenet-v2 <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/mobilenet-v2-pytorch>`__
|
||||
* - `mobilenet-v2 <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/public/mobilenet-v2-pytorch>`__
|
||||
- Mobilenet V2 PyTorch
|
||||
- classification
|
||||
- 224x224
|
||||
* - `resnet-50 <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf>`__
|
||||
* - `resnet-50 <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/public/resnet-50-tf>`__
|
||||
- ResNet-50_v1_ILSVRC-2012
|
||||
- classification
|
||||
- 224x224
|
||||
* - `ssd-mobilenet-v1-coco <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/ssd_mobilenet_v1_coco>`__
|
||||
* - `ssd-mobilenet-v1-coco <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/public/ssd_mobilenet_v1_coco>`__
|
||||
- ssd-mobilenet-V1-coco onnx model
|
||||
- object detection
|
||||
- 300x300
|
||||
* - `ssd-resnet34-1200-onnx <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/ssd-resnet34-1200-onnx>`__
|
||||
* - `ssd-resnet34-1200-onnx <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/public/ssd-resnet34-1200-onnx>`__
|
||||
- ssd-resnet34 onnx model
|
||||
- object detection
|
||||
- 1200x1200
|
||||
* - `unet-camvid-onnx-0001 <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/intel/unet-camvid-onnx-0001>`__
|
||||
* - `unet-camvid-onnx-0001 <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/intel/unet-camvid-onnx-0001>`__
|
||||
- U-Net
|
||||
- semantic segmentation
|
||||
- 368x480
|
||||
* - `yolo-v3-tiny <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/yolo-v3-tiny-tf>`__
|
||||
* - `yolo-v3-tiny <https://github.com/openvinotoolkit/open_../../documentation/legacy-features/model-zoo/tree/master/models/public/yolo-v3-tiny-tf>`__
|
||||
- YOLO v3 Tiny
|
||||
- object detection
|
||||
- 416x416
|
||||
|
|
@ -121,7 +121,7 @@ Performance Information F.A.Q.
|
|||
.. dropdown:: How can I optimize my models for better performance or accuracy?
|
||||
|
||||
Set of guidelines and recommendations to optimize models are available in the
|
||||
:doc:`optimization guide <openvino_docs_deployment_optimization_guide_dldt_optimization_guide>`.
|
||||
:doc:`optimization guide <../../openvino-workflow/running-inference/optimize-inference>`.
|
||||
Join the conversation in the `Community Forum <https://software.intel.com/en-us/forums/intel-distribution-of-openvino-toolkit>`__ for further support.
|
||||
|
||||
.. dropdown:: Why are INT8 optimized models used for benchmarking on CPUs with no VNNI support?
|
||||
|
|
@ -135,7 +135,7 @@ Performance Information F.A.Q.
|
|||
hardware. For comparison on boost factors for different network models
|
||||
and a selection of Intel® CPU architectures, including AVX-2 with Intel®
|
||||
Core™ i7-8700T, and AVX-512 (VNNI) with Intel® Xeon® 5218T and Intel®
|
||||
Xeon® 8270, refer to the :doc:`Model Accuracy for INT8 and FP32 Precision <openvino_docs_performance_int8_vs_fp32>`
|
||||
Xeon® 8270, refer to the :doc:`Model Accuracy for INT8 and FP32 Precision <model-accuracy-int8-fp32>`
|
||||
|
||||
.. dropdown:: Where can I search for OpenVINO™ performance results based on HW-platforms?
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ Support Change and Deprecation Notices
|
|||
|
||||
* The OpenVINO™ Development Tools package (pip install openvino-dev) is deprecated and will be
|
||||
removed from installation options and distribution channels beginning with 2025.0.
|
||||
For more details, refer to the :doc:`OpenVINO Legacy Features and Components <openvino_legacy_features>`
|
||||
For more details, refer to the :doc:`OpenVINO Legacy Features and Components <../documentation/legacy-features>`
|
||||
page.
|
||||
* Ubuntu 18.04 support will be discontinued in the 2023.3 LTS release. The recommended version
|
||||
of Ubuntu is 22.04.
|
||||
|
|
@ -77,9 +77,9 @@ Support Change and Deprecation Notices
|
|||
|
||||
* `Deployment Manager <https://docs.openvino.ai/2023.3/openvino_docs_install_guides_deployment_manager_tool.html>`__
|
||||
is deprecated and will be supported for two years according to our LTS policy.
|
||||
Visit our :doc:`selector tool <openvino_docs_install_guides_overview>` to see
|
||||
package distribution options or our :doc:`deployment guide <openvino_deployment_guide>`
|
||||
documentation.
|
||||
Visit our :doc:`selector tool <../get-started/install-openvino-overview>` to see
|
||||
package distribution options or our :doc:`deployment guide <../openvino-workflow/deployment-locally>`
|
||||
../documentation.
|
||||
* Accuracy Checker is deprecated and will be discontinued with 2024.0.
|
||||
* Post-Training Optimization Tool (POT) has been deprecated and the 2023.3 LTS will be
|
||||
the last release that will support the tool. Developers are encouraged to use the Neural
|
||||
|
|
@ -87,7 +87,7 @@ Support Change and Deprecation Notices
|
|||
* Model Optimizer is deprecated and will be fully supported until the 2025.0 release.
|
||||
We encourage developers to perform model conversion through OpenVINO Model Converter
|
||||
(API call: OVC). Follow the
|
||||
:doc:`model conversion transition guide <openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition>`
|
||||
:doc:`model conversion transition guide <../documentation/legacy-features/transition-legacy-conversion-api>`
|
||||
for more details.
|
||||
* Deprecated support for a `git patch <https://github.com/openvinotoolkit/nncf/tree/develop/third_party_integration/huggingface_transformers>`__
|
||||
for NNCF integration with `huggingface/transformers <https://github.com/huggingface/transformers>`__.
|
||||
|
|
@ -249,8 +249,8 @@ OpenVINO™ Runtime
|
|||
* Inference functions (``InferRequest.infer/start_async``, ``CompiledModel.__call__`` etc.) support OVDict as the input.
|
||||
* PILLOW interpolation modes bindings. (`PR #21188 <https://github.com/openvinotoolkit/openvino/pull/21188>`__ external contribution: @meetpatel0963)
|
||||
|
||||
* Torchvision to :doc:`OpenVINO preprocessing <openvino_docs_OV_UG_string_tensors>`
|
||||
converter documentation has been added to OpenVINO docs.
|
||||
* Torchvision to :doc:`OpenVINO preprocessing <../openvino-workflow/running-inference/string-tensors>`
|
||||
converter ../documentation has been added to OpenVINO docs.
|
||||
|
||||
|
||||
OpenVINO Ecosystem
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ System Requirements
|
|||
Certain hardware (including but not limited to GPU, GNA, and latest CPUs) requires manual
|
||||
installation of specific drivers and/or other software components to work correctly and/or
|
||||
to utilize hardware capabilities at their best. This might require updates to operating
|
||||
system, including but not limited to Linux kernel, please refer to their documentation
|
||||
system, including but not limited to Linux kernel, please refer to their ../documentation
|
||||
for details. These modifications should be handled by user and are not part of OpenVINO
|
||||
installation.
|
||||
|
||||
|
|
@ -93,10 +93,10 @@ Intel® Neural Processing Unit
|
|||
|
||||
.. tab-item:: Additional considerations
|
||||
|
||||
* These Accelerators require :doc:`drivers <openvino_docs_install_guides_configurations_for_intel_npu>`
|
||||
* These Accelerators require :doc:`drivers <../get-started/configurations-header/configurations-intel-npu>`
|
||||
that are not included in the Intel® Distribution of OpenVINO™ toolkit package.
|
||||
* Users can access the NPU plugin through the OpenVINO archives on
|
||||
the :doc:`download page <openvino_docs_install_guides_overview>`.
|
||||
the :doc:`download page <../get-started/install-openvino-overview>`.
|
||||
|
||||
|
||||
Intel® Gaussian & Neural Accelerator
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ Documentation
|
|||
:hidden:
|
||||
|
||||
API Reference <api/api_reference>
|
||||
OpenVINO IR format and Operation Sets <openvino_ir>
|
||||
Legacy Features <openvino_legacy_features>
|
||||
Tool Ecosystem <openvino_ecosystem>
|
||||
OpenVINO Extensibility <openvino_docs_Extensibility_UG_Intro>
|
||||
OpenVINO™ Security <openvino_docs_security_guide_introduction>
|
||||
OpenVINO IR format and Operation Sets <documentation/openvino-ir-format>
|
||||
Legacy Features <documentation/legacy-features>
|
||||
Tool Ecosystem <documentation/openvino-ecosystem>
|
||||
OpenVINO Extensibility <documentation/openvino-extensibility>
|
||||
OpenVINO™ Security <documentation/openvino-security>
|
||||
|
||||
|
||||
This section provides reference documents that guide you through the OpenVINO toolkit workflow, from preparing models, optimizing them, to deploying them in your own deep learning applications.
|
||||
|
|
@ -26,12 +26,12 @@ This section provides reference documents that guide you through the OpenVINO to
|
|||
| :doc:`API Reference doc path <api/api_reference>`
|
||||
| A collection of reference articles for OpenVINO C++, C, and Python APIs.
|
||||
|
||||
| :doc:`OpenVINO Ecosystem <openvino_ecosystem>`
|
||||
| :doc:`OpenVINO Ecosystem <documentation/openvino-ecosystem>`
|
||||
| Apart from the core components, OpenVINO offers tools, plugins, and expansions revolving around it, even if not constituting necessary parts of its workflow. This section gives you an overview of what makes up the OpenVINO toolkit.
|
||||
|
||||
| :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>`
|
||||
| :doc:`OpenVINO Extensibility Mechanism <documentation/openvino-extensibility>`
|
||||
| The Intel® Distribution of OpenVINO™ toolkit supports neural network models trained with various frameworks, including TensorFlow, PyTorch, ONNX, TensorFlow Lite, and PaddlePaddle. Learn how to extend OpenVINO functionality with custom settings.
|
||||
|
||||
| :doc:`OpenVINO™ Security <openvino_docs_security_guide_introduction>`
|
||||
| :doc:`OpenVINO™ Security <documentation/openvino-security>`
|
||||
| Learn how to use OpenVINO securely and protect your data to meet specific security and privacy requirements.
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ Legacy Features and Components
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
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>
|
||||
Open Model ZOO <model_zoo>
|
||||
OpenVINO Development Tools package <legacy-features/install-dev-tools>
|
||||
Model Optimizer / Conversion API <legacy-features/transition-legacy-conversion-api>
|
||||
Open Model ZOO <legacy-features/model-zoo>
|
||||
|
||||
|
||||
Since OpenVINO has grown very rapidly in recent years, a number of its features
|
||||
|
|
@ -32,7 +32,7 @@ offering.
|
|||
Accuracy Checker, Annotation Converter, Post-Training Optimization Tool,
|
||||
and Open Model Zoo tools. Most of these tools have been either removed,
|
||||
replaced by other solutions, or moved to the OpenVINO Runtime package.
|
||||
| :doc:`See how to install Development Tools <openvino_docs_install_guides_install_dev_tools>`
|
||||
| :doc:`See how to install Development Tools <legacy-features/install-dev-tools>`
|
||||
|
||||
|
||||
| **Model Optimizer / Conversion API**
|
||||
|
|
@ -43,8 +43,8 @@ offering.
|
|||
when all major model frameworks became supported directly. For converting model
|
||||
files explicitly, it has been replaced with a more light-weight and efficient
|
||||
solution, the OpenVINO Converter (launched with OpenVINO 2023.1).
|
||||
| :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>`
|
||||
| :doc:`See how to use OVC <../openvino-workflow/model-preparation>`
|
||||
| :doc:`See how to transition from the legacy solution <legacy-features/transition-legacy-conversion-api>`
|
||||
|
||||
|
||||
| **Open Model ZOO**
|
||||
|
|
@ -55,9 +55,9 @@ offering.
|
|||
and a small set of tools enabling a level of automation for the process.
|
||||
Since the tools have been mostly replaced by other solutions and several
|
||||
other model repositories have recently grown in size and popularity,
|
||||
Open Model ZOO will no longer be maintained. You may still use its resources
|
||||
Open Model ZOO will no longer be maintained. You may still use its ../about-openvino/additional-resources
|
||||
until they are fully removed.
|
||||
| :doc:`See the Open Model ZOO documentation <model_zoo>`
|
||||
| :doc:`See the Open Model ZOO documentation <legacy-features/model-zoo>`
|
||||
| `Check the OMZ GitHub project <https://github.com/openvinotoolkit/open_model_zoo>`__
|
||||
|
||||
| **Apache MXNet, Caffe, and Kaldi model formats**
|
||||
|
|
@ -65,7 +65,7 @@ offering.
|
|||
| *Old solution:* model support discontinued with OpenVINO 2024.0
|
||||
|
|
||||
| `The last version supporting Apache MXNet, Caffe, and Kaldi model formats <https://docs.openvino.ai/2023.3/mxnet_caffe_kaldi.html>`__
|
||||
| :doc:`See the currently supported frameworks <openvino_docs_model_processing_introduction>`
|
||||
| :doc:`See the currently supported frameworks <../openvino-workflow/model-preparation>`
|
||||
|
||||
|
||||
| **Post-training Optimization Tool (POT)**
|
||||
|
|
@ -75,7 +75,7 @@ offering.
|
|||
| Neural Network Compression Framework (NNCF) now offers the same functionality as POT,
|
||||
apart from its original feature set.
|
||||
|
||||
| :doc:`See how to use NNCF for model optimization <openvino_docs_model_optimization_guide>`
|
||||
| :doc:`See how to use NNCF for model optimization <../openvino-workflow/model-optimization>`
|
||||
| `Check the NNCF GitHub project, including documentation <https://github.com/openvinotoolkit/nncf>`__
|
||||
|
||||
| **Inference API 1.0**
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ If you are a Python developer, follow the steps in the :ref:`Installing OpenVINO
|
|||
For C/C++ Developers
|
||||
#######################
|
||||
|
||||
If you are a C/C++ developer, you must first install OpenVINO Runtime separately to set up the C/C++ libraries, sample code, and dependencies for building applications with OpenVINO. These files are not included with the PyPI distribution. See the :doc:`Selector Tool <openvino_docs_install_guides_overview>` page to install OpenVINO Runtime from an archive file for your operating system.
|
||||
If you are a C/C++ developer, you must first install OpenVINO Runtime separately to set up the C/C++ libraries, sample code, and dependencies for building applications with OpenVINO. These files are not included with the PyPI distribution. See the :doc:`Selector Tool <../../get-started/install-openvino-overview>` page to install OpenVINO Runtime from an archive file for your operating system.
|
||||
|
||||
Once OpenVINO Runtime is installed, you may install OpenVINO Development Tools for access to tools like ``mo``, Model Downloader, Benchmark Tool, and other utilities that will help you optimize your model and develop your application. Follow the steps in the :ref:`Installing OpenVINO Development Tools <install_dev_tools>` section on this page to install it.
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ To verify the package is properly installed, run the command below (this may tak
|
|||
|
||||
mo -h
|
||||
|
||||
You will see the help message for ``mo`` if installation finished successfully. If you get an error, refer to the :doc:`Troubleshooting Guide <openvino_docs_get_started_guide_troubleshooting>` for possible solutions.
|
||||
You will see the help message for ``mo`` if installation finished successfully. If you get an error, refer to the :doc:`Troubleshooting Guide <../../get-started/troubleshooting-install-config>` for possible solutions.
|
||||
|
||||
Congratulations! You finished installing OpenVINO Development Tools with C/C++ capability. Now you can start exploring OpenVINO's functionality through example C/C++ applications. See the "What's Next?" section to learn more!
|
||||
|
||||
|
|
@ -173,38 +173,38 @@ Learn more about OpenVINO and use it in your own application by trying out some
|
|||
Get started with Python
|
||||
+++++++++++++++++++++++
|
||||
|
||||
.. image:: _static/images/get_started_with_python.gif
|
||||
.. image:: ../../_static/images/get_started_with_python.gif
|
||||
:width: 400
|
||||
|
||||
Try the `Python Quick Start Example <notebooks/201-vision-monodepth-with-output.html>`__ to estimate depth in a scene using an OpenVINO monodepth model in a Jupyter Notebook inside your web browser.
|
||||
Try the `Python Quick Start Example <../../notebooks/201-vision-monodepth-with-output.html>`__ to estimate depth in a scene using an OpenVINO monodepth model in a Jupyter Notebook inside your web browser.
|
||||
|
||||
Visit the :doc:`Tutorials <tutorials>` page for more Jupyter Notebooks to get you started with OpenVINO, such as:
|
||||
Visit the :doc:`Tutorials <../../learn-openvino/interactive-tutorials-python>` page for more Jupyter Notebooks to get you started with OpenVINO, such as:
|
||||
|
||||
* `OpenVINO Python API Tutorial <notebooks/002-openvino-api-with-output.html>`__
|
||||
* `Basic image classification program with Hello Image Classification <notebooks/001-hello-world-with-output.html>`__
|
||||
* `Convert a PyTorch model and use it for image background removal <notebooks/205-vision-background-removal-with-output.html>`__
|
||||
* `OpenVINO Python API Tutorial <../../notebooks/002-openvino-api-with-output.html>`__
|
||||
* `Basic image classification program with Hello Image Classification <../../notebooks/001-hello-world-with-output.html>`__
|
||||
* `Convert a PyTorch model and use it for image background removal <../../notebooks/205-vision-background-removal-with-output.html>`__
|
||||
|
||||
Get started with C++
|
||||
++++++++++++++++++++
|
||||
|
||||
.. image:: _static/images/get_started_with_cpp.jpg
|
||||
.. image:: ../../_static/images/get_started_with_cpp.jpg
|
||||
:width: 400
|
||||
|
||||
|
||||
Try the :doc:`C++ Quick Start Example <openvino_docs_get_started_get_started_demos>` for step-by-step instructions on building and running a basic image classification C++ application.
|
||||
Try the :doc:`C++ Quick Start Example <../../learn-openvino/openvino-samples/get-started-demos>` for step-by-step instructions on building and running a basic image classification C++ application.
|
||||
|
||||
Visit the :doc:`Samples <openvino_docs_OV_UG_Samples_Overview>` page for other C++ example applications to get you started with OpenVINO, such as:
|
||||
Visit the :doc:`Samples <../../learn-openvino/openvino-samples>` page for other C++ example applications to get you started with OpenVINO, such as:
|
||||
|
||||
* :doc:`Basic object detection with the Hello Reshape SSD C++ sample <openvino_sample_hello_reshape_ssd>`
|
||||
* :doc:`Object classification sample <openvino_sample_hello_classification>`
|
||||
* :doc:`Basic object detection with the Hello Reshape SSD C++ sample <../../learn-openvino/openvino-samples/hello-reshape-ssd>`
|
||||
* :doc:`Object classification sample <../../learn-openvino/openvino-samples/hello-classification>`
|
||||
|
||||
Learn OpenVINO Development Tools
|
||||
++++++++++++++++++++++++++++++++
|
||||
|
||||
* Explore a variety of pre-trained deep learning models in the :doc:`Open Model Zoo <model_zoo>` and deploy them in demo applications to see how they work.
|
||||
* Want to import a model from another framework and optimize its performance with OpenVINO? Visit the :doc:`Convert a Model <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` page.
|
||||
* Accelerate your model's speed even further with quantization and other compression techniques using :doc:`Neural Network Compression Framework (NNCF) <ptq_introduction>`.
|
||||
* Benchmark your model's inference speed with one simple command using the :doc:`Benchmark Tool <openvino_sample_benchmark_tool>`.
|
||||
* Explore a variety of pre-trained deep learning models in the :doc:`Open Model Zoo <model-zoo>` and deploy them in demo applications to see how they work.
|
||||
* Want to import a model from another framework and optimize its performance with OpenVINO? Visit the :doc:`Convert a Model <transition-legacy-conversion-api/legacy-conversion-api>` page.
|
||||
* Accelerate your model's speed even further with quantization and other compression techniques using :doc:`Neural Network Compression Framework (NNCF) <../../openvino-workflow/model-optimization-guide/quantizing-models-post-training>`.
|
||||
* Benchmark your model's inference speed with one simple command using the :doc:`Benchmark Tool <../../learn-openvino/openvino-samples/benchmark-tool>`.
|
||||
|
||||
Additional Resources
|
||||
####################
|
||||
|
|
|
|||
|
|
@ -10,28 +10,28 @@ Model Zoo
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
omz_models_group_intel
|
||||
omz_models_group_public
|
||||
../../omz_models_group_intel
|
||||
../../omz_models_group_public
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
omz_tools_downloader
|
||||
omz_tools_accuracy_checker
|
||||
omz_data_datasets
|
||||
omz_demos
|
||||
../../omz_tools_downloader
|
||||
../../omz_tools_accuracy_checker
|
||||
../../omz_data_datasets
|
||||
../../omz_demos
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
omz_model_api_ovms_adapter
|
||||
../../omz_model_api_ovms_adapter
|
||||
|
||||
|
||||
Open Model Zoo for OpenVINO™ toolkit delivers a wide variety of free, pre-trained deep learning models and demo applications that provide full application templates to help you implement deep learning in Python, C++, or OpenCV Graph API (G-API). Models and demos are available in the `Open Model Zoo GitHub repo <https://github.com/openvinotoolkit/open_model_zoo>`__ and licensed under Apache License Version 2.0.
|
||||
|
||||
Browse through over 200 neural network models, both :doc:`public <omz_models_group_public>` and from :doc:`Intel <omz_models_group_intel>`, and pick the right one for your solution. Types include object detection, classification, image segmentation, handwriting recognition, text to speech, pose estimation, and others. The Intel models have already been converted to work with OpenVINO™ toolkit, while public models can easily be converted using the :doc:`OpenVINO Model Conversion API <openvino_docs_model_processing_introduction>` utility.
|
||||
Browse through over 200 neural network models, both :doc:`public <../../omz_models_group_public>` and from :doc:`Intel <../../omz_models_group_intel>`, and pick the right one for your solution. Types include object detection, classification, image segmentation, handwriting recognition, text to speech, pose estimation, and others. The Intel models have already been converted to work with OpenVINO™ toolkit, while public models can easily be converted using the :doc:`OpenVINO Model Conversion API <../../openvino-workflow/model-preparation>` utility.
|
||||
|
||||
Get started with simple :doc:`step-by-step procedures <openvino_docs_get_started_get_started_demos>` to learn how to build and run demo applications or discover the :doc:`full set of demos <omz_demos>` and adapt them for implementing specific deep learning scenarios in your applications.
|
||||
Get started with simple :doc:`step-by-step procedures <../../learn-openvino/openvino-samples/get-started-demos>` to learn how to build and run demo applications or discover the :doc:`full set of demos <../../omz_demos>` and adapt them for implementing specific deep learning scenarios in your applications.
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Transition from Legacy Conversion API
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide
|
||||
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer
|
||||
transition-legacy-conversion-api/legacy-conversion-api
|
||||
transition-legacy-conversion-api/legacy-model-optimizer-extensibility
|
||||
|
||||
In the 2023.1 OpenVINO release OpenVINO Model Converter was introduced with the corresponding
|
||||
Python API: ``openvino.convert_model`` method. ``ovc`` and ``openvino.convert_model`` represent
|
||||
|
|
@ -327,7 +327,7 @@ Here is the guide to transition from legacy model preprocessing to new API prepr
|
|||
prep.input(input_name).preprocess().mean([0.5, 0.5, 0.5])
|
||||
ov_model = prep.build()
|
||||
|
||||
There is currently no heuristic for automatic detection of the channel to which mean, scale or reverse channels should be applied. ``Layout`` needs to be explicitly specified with "C" channel. For example "NHWC", "NCHW", "?C??". See also :doc:`Layout API overview <openvino_docs_OV_UG_Layout_Overview>`.
|
||||
There is currently no heuristic for automatic detection of the channel to which mean, scale or reverse channels should be applied. ``Layout`` needs to be explicitly specified with "C" channel. For example "NHWC", "NCHW", "?C??". See also :doc:`Layout API overview <../../openvino-workflow/running-inference/optimize-inference/optimizie-preprocessing/layout-api-overview>`.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
|
@ -376,7 +376,7 @@ Here is the guide to transition from legacy model preprocessing to new API prepr
|
|||
prep.input(input_name).preprocess().scale([255., 255., 255.])
|
||||
ov_model = prep.build()
|
||||
|
||||
There is currently no heuristic for automatic detection of the channel to which mean, scale or reverse channels should be applied. ``Layout`` needs to be explicitly specified with "C" channel. For example "NHWC", "NCHW", "?C??". See also :doc:`Layout API overview <openvino_docs_OV_UG_Layout_Overview>`.
|
||||
There is currently no heuristic for automatic detection of the channel to which mean, scale or reverse channels should be applied. ``Layout`` needs to be explicitly specified with "C" channel. For example "NHWC", "NCHW", "?C??". See also :doc:`Layout API overview <../../openvino-workflow/running-inference/optimize-inference/optimizie-preprocessing/layout-api-overview>`.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
|
@ -425,7 +425,7 @@ Here is the guide to transition from legacy model preprocessing to new API prepr
|
|||
prep.input(input_name).preprocess().reverse_channels()
|
||||
ov_model = prep.build()
|
||||
|
||||
There is currently no heuristic for automatic detection of the channel to which mean, scale or reverse channels should be applied. ``Layout`` needs to be explicitly specified with "C" channel. For example "NHWC", "NCHW", "?C??". See also :doc:`Layout API overview <openvino_docs_OV_UG_Layout_Overview>`.
|
||||
There is currently no heuristic for automatic detection of the channel to which mean, scale or reverse channels should be applied. ``Layout`` needs to be explicitly specified with "C" channel. For example "NHWC", "NCHW", "?C??". See also :doc:`Layout API overview <../../openvino-workflow/running-inference/optimize-inference/optimizie-preprocessing/layout-api-overview>`.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@ Legacy Conversion API
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
Setting Input Shapes <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>
|
||||
Troubleshooting Reshape Errors <troubleshooting_reshape_errors>
|
||||
Cutting Off Parts of a Model <openvino_docs_MO_DG_prepare_model_convert_model_Cutting_Model>
|
||||
Embedding Preprocessing Computation <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>
|
||||
Compressing a Model to FP16 <openvino_docs_MO_DG_FP16_Compression>
|
||||
Convert Models Represented as Python Objects <openvino_docs_MO_DG_Python_API>
|
||||
Model Optimizer Frequently Asked Questions <openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ>
|
||||
Supported Model Formats <Supported_Model_Formats_MO_DG>
|
||||
Setting Input Shapes <legacy-conversion-api/[legacy]-setting-input-shapes>
|
||||
Troubleshooting Reshape Errors <legacy-conversion-api/[legacy]-troubleshooting-reshape-errors>
|
||||
Cutting Off Parts of a Model <legacy-conversion-api/[legacy]-cutting-parts-of-a-model>
|
||||
Embedding Preprocessing Computation <legacy-conversion-api/[legacy]-embedding-preprocessing-computation>
|
||||
Compressing a Model to FP16 <legacy-conversion-api/[legacy]-compressing-model-to-fp16>
|
||||
Convert Models Represented as Python Objects <legacy-conversion-api/[legacy]-convert-models-as-python-objects>
|
||||
Model Optimizer Frequently Asked Questions <legacy-conversion-api/[legacy]-model-optimizer-faq>
|
||||
Supported Model Formats <legacy-conversion-api/[legacy]-supported-model-formats>
|
||||
|
||||
.. meta::
|
||||
:description: Model conversion (MO) furthers the transition between training and
|
||||
|
|
@ -23,7 +23,7 @@ Legacy Conversion API
|
|||
optimal execution on target devices.
|
||||
|
||||
.. note::
|
||||
This part of the documentation describes a legacy approach to model conversion. Starting with OpenVINO 2023.1, a simpler alternative API for model conversion is available: ``openvino.convert_model`` and OpenVINO Model Converter ``ovc`` CLI tool. Refer to :doc:`Model preparation <openvino_docs_model_processing_introduction>` for more details. If you are still using `openvino.tools.mo.convert_model` or `mo` CLI tool, you can still refer to this documentation. However, consider checking the :doc:`transition guide <openvino_docs_OV_Converter_UG_prepare_model_convert_model_MO_OVC_transition>` to learn how to migrate from the legacy conversion API to the new one. Depending on the model topology, the new API can be a better option for you.
|
||||
This part of the ../../../documentation describes a legacy approach to model conversion. Starting with OpenVINO 2023.1, a simpler alternative API for model conversion is available: ``openvino.convert_model`` and OpenVINO Model Converter ``ovc`` CLI tool. Refer to :doc:`Model preparation <../../../openvino-workflow/model-preparation>` for more details. If you are still using `openvino.tools.mo.convert_model` or `mo` CLI tool, you can still refer to this ../../../documentation. However, consider checking the :doc:`transition guide <../transition-legacy-conversion-api>` to learn how to migrate from the legacy conversion API to the new one. Depending on the model topology, the new API can be a better option for you.
|
||||
|
||||
To convert a model to OpenVINO model format (``ov.Model``), you can use the following command:
|
||||
|
||||
|
|
@ -50,19 +50,19 @@ If the out-of-the-box conversion (only the ``input_model`` parameter is specifie
|
|||
|
||||
- ``input`` and ``input_shape`` - the model conversion API parameters used to override original input shapes for model conversion,
|
||||
|
||||
For more information about the parameters, refer to the :doc:`Setting Input Shapes <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
For more information about the parameters, refer to the :doc:`Setting Input Shapes <legacy-conversion-api/[legacy]-setting-input-shapes>` guide.
|
||||
|
||||
- ``input`` and ``output`` - the model conversion API parameters used to define new inputs and outputs of the converted model to cut off unwanted parts (such as unsupported operations and training sub-graphs),
|
||||
|
||||
For a more detailed description, refer to the :doc:`Cutting Off Parts of a Model <openvino_docs_MO_DG_prepare_model_convert_model_Cutting_Model>` guide.
|
||||
For a more detailed description, refer to the :doc:`Cutting Off Parts of a Model <legacy-conversion-api/[legacy]-cutting-parts-of-a-model>` guide.
|
||||
|
||||
- ``mean_values``, ``scales_values``, ``layout`` - the parameters used to insert additional input pre-processing sub-graphs into the converted model,
|
||||
|
||||
For more details, see the :doc:`Embedding Preprocessing Computation <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>` article.
|
||||
For more details, see the :doc:`Embedding Preprocessing Computation <legacy-conversion-api/[legacy]-embedding-preprocessing-computation>` article.
|
||||
|
||||
- ``compress_to_fp16`` - a compression parameter in ``mo`` command-line tool, which allows generating IR with constants (for example, weights for convolutions and matrix multiplications) compressed to ``FP16`` data type.
|
||||
|
||||
For more details, refer to the :doc:`Compression of a Model to FP16 <openvino_docs_MO_DG_FP16_Compression>` guide.
|
||||
For more details, refer to the :doc:`Compression of a Model to FP16 <legacy-conversion-api/[legacy]-compressing-model-to-fp16>` guide.
|
||||
|
||||
To get the full list of conversion parameters, run the following command:
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ Below is a list of separate examples for different frameworks and model conversi
|
|||
mo --saved_model_dir BERT --input_shape [2,30],[2,30],[2,30]
|
||||
|
||||
|
||||
For more information, refer to the :doc:`Converting a TensorFlow Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` guide.
|
||||
For more information, refer to the :doc:`Converting a TensorFlow Model <legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-convert-tensorflow>` guide.
|
||||
|
||||
2. Launch model conversion for an ONNX OCR model and specify new output explicitly:
|
||||
|
||||
|
|
@ -155,11 +155,11 @@ Below is a list of separate examples for different frameworks and model conversi
|
|||
mo --input_model ocr.onnx --output probabilities
|
||||
|
||||
|
||||
For more information, refer to the :doc:`Converting an ONNX Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>` guide.
|
||||
For more information, refer to the :doc:`Converting an ONNX Model <legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-convert-onnx>` guide.
|
||||
|
||||
.. note::
|
||||
|
||||
PyTorch models must be exported to the ONNX format before conversion into IR. More information can be found in :doc:`Converting a PyTorch Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_PyTorch>`.
|
||||
PyTorch models must be exported to the ONNX format before conversion into IR. More information can be found in :doc:`Converting a PyTorch Model <legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-convert-pytorch>`.
|
||||
|
||||
3. Launch model conversion for a PaddlePaddle UNet model and apply mean-scale normalization to the input:
|
||||
|
||||
|
|
@ -182,9 +182,9 @@ Below is a list of separate examples for different frameworks and model conversi
|
|||
mo --input_model unet.pdmodel --mean_values [123,117,104] --scale 255
|
||||
|
||||
|
||||
For more information, refer to the :doc:`Converting a PaddlePaddle Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle>` guide.
|
||||
For more information, refer to the :doc:`Converting a PaddlePaddle Model <legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-convert-paddle>` guide.
|
||||
|
||||
- To get conversion recipes for specific TensorFlow, ONNX, and PyTorch models, refer to the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>`.
|
||||
- For more information about IR, see :doc:`Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™ <openvino_docs_MO_DG_IR_and_opsets>`.
|
||||
- For more information about support of neural network models trained with various frameworks, see :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>`
|
||||
- To get conversion recipes for specific TensorFlow, ONNX, and PyTorch models, refer to the :doc:`Model Conversion Tutorials <legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials>`.
|
||||
- For more information about IR, see :doc:`Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™ <../../openvino-ir-format/operation-sets>`.
|
||||
- For more information about support of neural network models trained with various frameworks, see :doc:`OpenVINO Extensibility Mechanism <../../openvino-extensibility>`
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Conversion Parameters <openvino_docs_OV_Converter_UG_Conversion_Options>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Conversion Parameters <../../../../openvino-workflow/model-preparation/conversion-parameters>` article.
|
||||
|
||||
By default, when IR is saved all relevant floating-point weights are compressed to ``FP16`` data type during model conversion.
|
||||
It results in creating a "compressed ``FP16`` model", which occupies about half of
|
||||
|
|
@ -37,12 +37,12 @@ To disable compression, use the ``compress_to_fp16=False`` option:
|
|||
|
||||
|
||||
For details on how plugins handle compressed ``FP16`` models, see
|
||||
:doc:`Inference Devices and Modes <openvino_docs_Runtime_Inference_Modes_Overview>`.
|
||||
:doc:`Inference Devices and Modes <../../../../openvino-workflow/running-inference/inference-devices-and-modes>`.
|
||||
|
||||
.. note::
|
||||
|
||||
``FP16`` compression is sometimes used as the initial step for ``INT8`` quantization.
|
||||
Refer to the :doc:`Post-training optimization <ptq_introduction>` guide for more
|
||||
Refer to the :doc:`Post-training optimization <../../../../openvino-workflow/model-optimization-guide/quantizing-models-post-training>` guide for more
|
||||
information about that.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Model Preparation <openvino_docs_model_processing_introduction>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Model Preparation <../../../../openvino-workflow/model-preparation>` article.
|
||||
|
||||
Model conversion API is represented by ``convert_model()`` method in openvino.tools.mo namespace. ``convert_model()`` is compatible with types from openvino.runtime, like PartialShape, Layout, Type, etc.
|
||||
|
||||
|
|
@ -32,8 +32,8 @@ Example of converting a PyTorch model directly from memory:
|
|||
|
||||
The following types are supported as an input model for ``convert_model()``:
|
||||
|
||||
* PyTorch - ``torch.nn.Module``, ``torch.jit.ScriptModule``, ``torch.jit.ScriptFunction``. Refer to the :doc:`Converting a PyTorch Model<openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_PyTorch>` article for more details.
|
||||
* TensorFlow / TensorFlow 2 / Keras - ``tf.keras.Model``, ``tf.keras.layers.Layer``, ``tf.compat.v1.Graph``, ``tf.compat.v1.GraphDef``, ``tf.Module``, ``tf.function``, ``tf.compat.v1.session``, ``tf.train.checkpoint``. Refer to the :doc:`Converting a TensorFlow Model<openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` article for more details.
|
||||
* PyTorch - ``torch.nn.Module``, ``torch.jit.ScriptModule``, ``torch.jit.ScriptFunction``. Refer to the :doc:`Converting a PyTorch Model<[legacy]-supported-model-formats/[legacy]-convert-pytorch>` article for more details.
|
||||
* TensorFlow / TensorFlow 2 / Keras - ``tf.keras.Model``, ``tf.keras.layers.Layer``, ``tf.compat.v1.Graph``, ``tf.compat.v1.GraphDef``, ``tf.Module``, ``tf.function``, ``tf.compat.v1.session``, ``tf.train.checkpoint``. Refer to the :doc:`Converting a TensorFlow Model<[legacy]-supported-model-formats/[legacy]-convert-tensorflow>` article for more details.
|
||||
|
||||
``convert_model()`` accepts all parameters available in the MO command-line tool. Parameters can be specified by Python classes or string analogs, similar to the command-line tool.
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ Model conversion API parameters
|
|||
|
||||
Model conversion API provides ``input`` and ``output`` command-line options to specify new entry and exit nodes, while ignoring the rest of the model:
|
||||
|
||||
* ``input`` option accepts a list of layer names of the input model that should be treated as new entry points to the model. See the full list of accepted types for input on :doc:`Model Conversion Python API <openvino_docs_MO_DG_Python_API>` page.
|
||||
* ``input`` option accepts a list of layer names of the input model that should be treated as new entry points to the model. See the full list of accepted types for input on :doc:`Model Conversion Python API <[legacy]-convert-models-as-python-objects>` page.
|
||||
* ``output`` option accepts a list of layer names of the input model that should be treated as new exit points from the model.
|
||||
|
||||
The ``input`` option is required for cases unrelated to model cutting. For example, when the model contains several inputs and ``input_shape`` or ``mean_values`` options are used, the ``input`` option specifies the order of input nodes for correct mapping between multiple items provided in ``input_shape`` and ``mean_values`` and the inputs in the model.
|
||||
|
||||
Model cutting is illustrated with the Inception V1 model, found in the ``models/research/slim`` repository. To proceed with this chapter, make sure you do the necessary steps to :doc:`prepare the model for model conversion <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>`.
|
||||
Model cutting is illustrated with the Inception V1 model, found in the ``models/research/slim`` repository. To proceed with this chapter, make sure you do the necessary steps to :doc:`prepare the model for model conversion <[legacy]-setting-input-shapes>`.
|
||||
|
||||
Default Behavior without input and output
|
||||
#########################################
|
||||
|
|
@ -43,14 +43,14 @@ The input model is converted as a whole if neither ``input`` nor ``output`` comm
|
|||
|
||||
For Inception_V1, there is one ``Placeholder``: input. If the model is viewed in TensorBoard, the input operation is easy to find:
|
||||
|
||||
.. image:: _static/images/inception_v1_std_input.svg
|
||||
.. image:: ../../../../_static/images/inception_v1_std_input.svg
|
||||
:alt: Placeholder in Inception V1
|
||||
|
||||
``Reshape`` is the only output operation, which is enclosed in a nested name scope of ``InceptionV1/Logits/Predictions``, under the full name of ``InceptionV1/Logits/Predictions/Reshape_1``.
|
||||
|
||||
In TensorBoard, along with some of its predecessors, it looks as follows:
|
||||
|
||||
.. image:: _static/images/inception_v1_std_output.svg
|
||||
.. image:: ../../../../_static/images/inception_v1_std_output.svg
|
||||
:alt: TensorBoard with predecessors
|
||||
|
||||
Convert this model to ``ov.Model``:
|
||||
|
|
@ -150,7 +150,7 @@ Model Cutting
|
|||
|
||||
Now, consider how to cut some parts of the model off. This chapter describes the first convolution block ``InceptionV1/InceptionV1/Conv2d_1a_7x7`` of the Inception V1 model to illustrate cutting:
|
||||
|
||||
.. image:: _static/images/inception_v1_first_block.svg
|
||||
.. image:: ../../../../_static/images/inception_v1_first_block.svg
|
||||
:alt: Inception V1 first convolution block
|
||||
|
||||
Cutting at the End
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Conversion Parameters <openvino_docs_OV_Converter_UG_Conversion_Options>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Conversion Parameters <../../../../openvino-workflow/model-preparation/conversion-parameters>` article.
|
||||
|
||||
Input data for inference can be different from the training dataset and requires
|
||||
additional preprocessing before inference. To accelerate the whole pipeline including
|
||||
|
|
@ -18,7 +18,7 @@ Based on these parameters, model conversion API generates OpenVINO IR with addit
|
|||
to perform the defined preprocessing. This preprocessing block can perform mean-scale
|
||||
normalization of input data, reverting data along channel dimension, and changing
|
||||
the data layout. See the following sections for details on the parameters, or the
|
||||
:doc:`Overview of Preprocessing API <openvino_docs_OV_UG_Preprocessing_Overview>`
|
||||
:doc:`Overview of Preprocessing API <../../../../openvino-workflow/running-inference/optimize-inference/optimizie-preprocessing>`
|
||||
for the same functionality in OpenVINO Runtime.
|
||||
|
||||
Specifying Layout
|
||||
|
|
@ -31,7 +31,7 @@ Layout defines the meaning of dimensions in shape and can be specified for both
|
|||
inputs and outputs. Some preprocessing requires to set input layouts, for example,
|
||||
setting a batch, applying mean or scales, and reversing input channels (BGR<->RGB).
|
||||
|
||||
For the layout syntax, check the :doc:`Layout API overview <openvino_docs_OV_UG_Layout_Overview>`.
|
||||
For the layout syntax, check the :doc:`Layout API overview <../../../../openvino-workflow/running-inference/optimize-inference/optimizie-preprocessing/layout-api-overview>`.
|
||||
To specify the layout, you can use the ``layout`` option followed by the layout value.
|
||||
|
||||
For example, the following command specifies the ``NHWC`` layout for a Tensorflow
|
||||
|
|
@ -251,5 +251,5 @@ model and embeds the ``reverse_input_channel`` preprocessing block into OpenVINO
|
|||
Additional Resources
|
||||
####################
|
||||
|
||||
* :doc:`Overview of Preprocessing API <openvino_docs_OV_UG_Preprocessing_Overview>`
|
||||
* :doc:`Overview of Preprocessing API <../../../../openvino-workflow/running-inference/optimize-inference/optimizie-preprocessing>`
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
.. important::
|
||||
|
||||
All of the issues below refer to :doc:`legacy functionalities <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`.
|
||||
All of the issues below refer to :doc:`legacy functionalities <../legacy-model-optimizer-extensibility>`.
|
||||
|
||||
If your question is not covered by the topics below, use the
|
||||
`OpenVINO Support page <https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/bd-p/distribution-openvino-toolkit>`__,
|
||||
|
|
@ -57,7 +57,7 @@ For example, to add the description of the ``CustomReshape`` layer, which is an
|
|||
|
||||
3. Now, Model Optimizer is able to load the model into memory and start working with your extensions if there are any.
|
||||
|
||||
However, since your model has custom layers, you must register them as custom. To learn more about it, refer to the :doc:`[Legacy] Custom Layers in Model Optimizer <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`.
|
||||
However, since your model has custom layers, you must register them as custom. To learn more about it, refer to the :doc:`[Legacy] Custom Layers in Model Optimizer <../legacy-model-optimizer-extensibility>`.
|
||||
|
||||
.. _question-2:
|
||||
|
||||
|
|
@ -81,8 +81,8 @@ Q3. What does the message "[ ERROR ]: Unable to create ports for node with id" m
|
|||
|
||||
**A:** Most likely, Model Optimizer does not know how to infer output shapes of some layers in the given topology.
|
||||
To lessen the scope, compile the list of layers that are custom for Model Optimizer: present in the topology,
|
||||
absent in the :doc:`list of supported operations <openvino_resources_supported_operations_frontend>` for the target framework.
|
||||
Then, refer to available options in the corresponding section in the :doc:`[Legacy] Custom Layers in Model Optimizer <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>` page.
|
||||
absent in the :doc:`list of supported operations <../../../../about-openvino/compatibility-and-support/supported-operations-framework-frontend>` for the target framework.
|
||||
Then, refer to available options in the corresponding section in the :doc:`[Legacy] Custom Layers in Model Optimizer <../legacy-model-optimizer-extensibility>` page.
|
||||
|
||||
.. _question-7:
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ However, if your model contains more than one input, Model Optimizer is able to
|
|||
Q9. What does the message "Mean file for topologies with multiple inputs is not supported" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** Model Optimizer does not support mean file processing for topologies with more than one input. In this case, you need to perform preprocessing of the inputs for a generated Intermediate Representation in OpenVINO Runtime to perform subtraction for every input of your multi-input model. See the :doc:`Overview of Preprocessing <openvino_docs_OV_UG_Preprocessing_Overview>` for details.
|
||||
**A:** Model Optimizer does not support mean file processing for topologies with more than one input. In this case, you need to perform preprocessing of the inputs for a generated Intermediate Representation in OpenVINO Runtime to perform subtraction for every input of your multi-input model. See the :doc:`Overview of Preprocessing <../../../../openvino-workflow/running-inference/optimize-inference/optimizie-preprocessing>` for details.
|
||||
|
||||
.. _question-11:
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ Q12. What does the message "Error happened while constructing caffe.Net in the C
|
|||
Q13. What does the message "Cannot infer shapes due to exception in Caffe" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** Model Optimizer tried to infer a custom layer via the Caffe framework, but the model could not be inferred using Caffe. This might happen if you try to convert the model with some noise weights and biases, which conflict with layers that have dynamic shapes. You should write your own extension for every custom layer your topology might have. For more details, refer to the :doc:`[Legacy] Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>` page.
|
||||
**A:** Model Optimizer tried to infer a custom layer via the Caffe framework, but the model could not be inferred using Caffe. This might happen if you try to convert the model with some noise weights and biases, which conflict with layers that have dynamic shapes. You should write your own extension for every custom layer your topology might have. For more details, refer to the :doc:`[Legacy] Model Optimizer Extensibility <../legacy-model-optimizer-extensibility>` page.
|
||||
|
||||
.. _question-14:
|
||||
|
||||
|
|
@ -254,7 +254,7 @@ Q16. What does the message "Input shape is required to convert MXNet model. Plea
|
|||
Q19. What does the message "Both --scale and --scale_values are defined. Specify either scale factor or scale values per input channels" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** The ``--scale`` option sets a scaling factor for all channels, while ``--scale_values`` sets a scaling factor per each channel. Using both of them simultaneously produces ambiguity, so you must use only one of them. For more information, refer to the **Using Framework-Agnostic Conversion Parameters** section: for :doc:`Converting a TensorFlow Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>`.
|
||||
**A:** The ``--scale`` option sets a scaling factor for all channels, while ``--scale_values`` sets a scaling factor per each channel. Using both of them simultaneously produces ambiguity, so you must use only one of them. For more information, refer to the **Using Framework-Agnostic Conversion Parameters** section: for :doc:`Converting a TensorFlow Model <[legacy]-supported-model-formats/[legacy]-convert-tensorflow>`.
|
||||
|
||||
.. _question-20:
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ Q23. What does the message "Discovered data node without inputs and value" mean?
|
|||
Q24. What does the message "Part of the nodes was not translated to IE. Stopped" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** Some of the operations are not supported by OpenVINO Runtime and cannot be translated to OpenVINO Intermediate Representation. You can extend Model Optimizer by allowing generation of new types of operations and implement these operations in the dedicated OpenVINO plugins. For more information, refer to the :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>` guide.
|
||||
**A:** Some of the operations are not supported by OpenVINO Runtime and cannot be translated to OpenVINO Intermediate Representation. You can extend Model Optimizer by allowing generation of new types of operations and implement these operations in the dedicated OpenVINO plugins. For more information, refer to the :doc:`OpenVINO Extensibility Mechanism <../../../openvino-extensibility>` guide.
|
||||
|
||||
.. _question-25:
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ Q32. What does the message "No or multiple placeholders in the model, but only o
|
|||
Q33. What does the message "The amount of input nodes for port is not equal to 1" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** This error occurs when the ``SubgraphMatch.single_input_node`` function is used for an input port that supplies more than one node in a sub-graph. The ``single_input_node`` function can be used only for ports that has a single consumer inside the matching sub-graph. When multiple nodes are connected to the port, use the ``input_nodes`` function or ``node_by_pattern`` function instead of ``single_input_node``. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Transformation_Extensions>` guide.
|
||||
**A:** This error occurs when the ``SubgraphMatch.single_input_node`` function is used for an input port that supplies more than one node in a sub-graph. The ``single_input_node`` function can be used only for ports that has a single consumer inside the matching sub-graph. When multiple nodes are connected to the port, use the ``input_nodes`` function or ``node_by_pattern`` function instead of ``single_input_node``. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <../legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions/[legacy]-graph-transformation-extensions>` guide.
|
||||
|
||||
.. _question-34:
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ Q34. What does the message "Output node for port has already been specified" mea
|
|||
Q35. What does the message "Unsupported match kind.... Match kinds "points" or "scope" are supported only" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** While using configuration file to implement a TensorFlow front replacement extension, an incorrect match kind was used. Only ``points`` or ``scope`` match kinds are supported. For more details, refer to the :doc:`[Legacy] Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>` guide.
|
||||
**A:** While using configuration file to implement a TensorFlow front replacement extension, an incorrect match kind was used. Only ``points`` or ``scope`` match kinds are supported. For more details, refer to the :doc:`[Legacy] Model Optimizer Extensibility <../legacy-model-optimizer-extensibility>` guide.
|
||||
|
||||
.. _question-36:
|
||||
|
||||
|
|
@ -378,7 +378,7 @@ Q36. What does the message "Cannot write an event file for the TensorBoard to di
|
|||
Q37. What does the message "There is no registered 'infer' function for node with op = .. . Please implement this function in the extensions" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A** Most likely, you tried to extend Model Optimizer with a new primitive, but you did not specify an infer function. For more information on extensions, see the :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>` guide.
|
||||
**A** Most likely, you tried to extend Model Optimizer with a new primitive, but you did not specify an infer function. For more information on extensions, see the :doc:`OpenVINO Extensibility Mechanism <../../../openvino-extensibility>` guide.
|
||||
|
||||
.. _question-38:
|
||||
|
||||
|
|
@ -413,7 +413,7 @@ Q41. What does the message "Shape for tensor is not defined. Can not proceed" me
|
|||
Q42. What does the message "Module TensorFlow was not found. Please install TensorFlow 1.2 or higher" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** To convert TensorFlow models with Model Optimizer, TensorFlow 1.2 or newer must be installed. For more information on prerequisites, see the :doc:`Configuring Model Optimizer <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` guide.
|
||||
**A:** To convert TensorFlow models with Model Optimizer, TensorFlow 1.2 or newer must be installed. For more information on prerequisites, see the :doc:`Configuring Model Optimizer <../legacy-conversion-api>` guide.
|
||||
|
||||
.. _question-43:
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ Q44. What does the message "Cannot pre-process TensorFlow graph after reading fr
|
|||
Q45. What does the message "Found custom layer. Model Optimizer does not support this layer. Please, register it in CustomLayersMapping.xml or implement extension" mean?
|
||||
##########################################################################################################################################################################
|
||||
|
||||
**A:** This means that the layer ``{layer_name}`` is not supported in Model Optimizer. You will find a list of all unsupported layers in the corresponding section. You should implement the extensions for this layer. See :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>` for more information.
|
||||
**A:** This means that the layer ``{layer_name}`` is not supported in Model Optimizer. You will find a list of all unsupported layers in the corresponding section. You should implement the extensions for this layer. See :doc:`OpenVINO Extensibility Mechanism <../../../openvino-extensibility>` for more information.
|
||||
|
||||
.. _question-46:
|
||||
|
||||
|
|
@ -448,7 +448,7 @@ Q46. What does the message "Custom replacement configuration file does not exist
|
|||
Q47. What does the message "Extractors collection have case insensitive duplicates" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** When extending Model Optimizer with new primitives, keep in mind that their names are case-insensitive. Most likely, another operation with the same name is already defined. For more information, see the :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>` guide.
|
||||
**A:** When extending Model Optimizer with new primitives, keep in mind that their names are case-insensitive. Most likely, another operation with the same name is already defined. For more information, see the :doc:`OpenVINO Extensibility Mechanism <../../../openvino-extensibility>` guide.
|
||||
|
||||
.. _question-48:
|
||||
|
||||
|
|
@ -483,7 +483,7 @@ Q51. What does the message "No node with name ..." mean?
|
|||
Q52. What does the message "Module MXNet was not found. Please install MXNet 1.0.0" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** To convert MXNet models with Model Optimizer, Apache MXNet 1.0.0 must be installed. For more information about prerequisites, see the :doc:`Configuring Model Optimizer <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` guide.
|
||||
**A:** To convert MXNet models with Model Optimizer, Apache MXNet 1.0.0 must be installed. For more information about prerequisites, see the :doc:`Configuring Model Optimizer <../legacy-conversion-api>` guide.
|
||||
|
||||
.. _question-53:
|
||||
|
||||
|
|
@ -504,7 +504,7 @@ Q54. What does the message "The following error happened while processing input
|
|||
Q55. What does the message "Attempt to register of custom name for the second time as class. Note that custom names are case-insensitive" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** When extending Model Optimizer with new primitives, keep in mind that their names are case-insensitive. Most likely, another operation with the same name is already defined. For more information, see the :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>` guide.
|
||||
**A:** When extending Model Optimizer with new primitives, keep in mind that their names are case-insensitive. Most likely, another operation with the same name is already defined. For more information, see the :doc:`OpenVINO Extensibility Mechanism <../../../openvino-extensibility>` guide.
|
||||
|
||||
.. _question-56:
|
||||
|
||||
|
|
@ -602,14 +602,14 @@ Q65. What does the message "No class registered for match kind ... Supported mat
|
|||
Q66. What does the message "No instance(s) is(are) defined for the custom replacement" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** A replacement defined in the configuration file for sub-graph replacement, using node names patterns or start/end nodes, has the ``instances`` attribute. This attribute is mandatory. This error will occur if the attribute is missing. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>` guide.
|
||||
**A:** A replacement defined in the configuration file for sub-graph replacement, using node names patterns or start/end nodes, has the ``instances`` attribute. This attribute is mandatory. This error will occur if the attribute is missing. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <../legacy-model-optimizer-extensibility>` guide.
|
||||
|
||||
.. _question-67:
|
||||
|
||||
Q67. What does the message "The instance must be a single dictionary for the custom replacement with id .." mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** A replacement defined in the configuration file for sub-graph replacement, using start/end nodes, has the ``instances`` attribute. For this type of replacement, the instance must be defined with a dictionary with two keys ``start_points`` and ``end_points``. Values for these keys are lists with the start and end node names, respectively. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Transformation_Extensions>` guide.
|
||||
**A:** A replacement defined in the configuration file for sub-graph replacement, using start/end nodes, has the ``instances`` attribute. For this type of replacement, the instance must be defined with a dictionary with two keys ``start_points`` and ``end_points``. Values for these keys are lists with the start and end node names, respectively. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <../legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions/[legacy]-graph-transformation-extensions>` guide.
|
||||
|
||||
.. _question-68:
|
||||
|
||||
|
|
@ -665,7 +665,7 @@ Q74. What does the message "End node .. is not reachable from start nodes: .." m
|
|||
Q75. What does the message "Sub-graph contains network input node .." mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** The start or end node for the sub-graph replacement using start/end nodes is specified incorrectly. Model Optimizer finds internal nodes of the sub-graph strictly "between" the start and end nodes, and then adds all input nodes to the sub-graph (and the inputs of their inputs, etc.) for these "internal" nodes. This error reports that Model Optimizer reached input node during this phase. This means that the start/end points are specified incorrectly in the configuration file. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Transformation_Extensions>` guide.
|
||||
**A:** The start or end node for the sub-graph replacement using start/end nodes is specified incorrectly. Model Optimizer finds internal nodes of the sub-graph strictly "between" the start and end nodes, and then adds all input nodes to the sub-graph (and the inputs of their inputs, etc.) for these "internal" nodes. This error reports that Model Optimizer reached input node during this phase. This means that the start/end points are specified incorrectly in the configuration file. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <../legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions/[legacy]-graph-transformation-extensions>` guide.
|
||||
|
||||
.. _question-76:
|
||||
|
||||
|
|
@ -686,7 +686,7 @@ Q77. What does the message "... elements of ... were clipped to zero while conve
|
|||
Q78. What does the message "The amount of nodes matched pattern ... is not equal to 1" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** This error occurs when the ``SubgraphMatch.node_by_pattern`` function is used with a pattern that does not uniquely identify a single node in a sub-graph. Try to extend the pattern string to make unambiguous match to a single sub-graph node. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Transformation_Extensions>` guide.
|
||||
**A:** This error occurs when the ``SubgraphMatch.node_by_pattern`` function is used with a pattern that does not uniquely identify a single node in a sub-graph. Try to extend the pattern string to make unambiguous match to a single sub-graph node. For more details, refer to the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <../legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions/[legacy]-graph-transformation-extensions>` guide.
|
||||
|
||||
.. _question-79:
|
||||
|
||||
|
|
@ -700,7 +700,7 @@ Q79. What does the message "The topology contains no "input" layers" mean?
|
|||
Q80. What does the message "Warning: please expect that Model Optimizer conversion might be slow" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** You are using an unsupported Python version. Use only versions 3.4 - 3.6 for the C++ ``protobuf`` implementation that is supplied with OpenVINO toolkit. You can still boost the conversion speed by building the protobuf library from sources. For complete instructions about building ``protobuf`` from sources, see the appropriate section in the :doc:`Converting a Model to Intermediate Representation <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` guide.
|
||||
**A:** You are using an unsupported Python version. Use only versions 3.4 - 3.6 for the C++ ``protobuf`` implementation that is supplied with OpenVINO toolkit. You can still boost the conversion speed by building the protobuf library from sources. For complete instructions about building ``protobuf`` from sources, see the appropriate section in the :doc:`Converting a Model to Intermediate Representation <../legacy-conversion-api>` guide.
|
||||
|
||||
.. _question-81:
|
||||
|
||||
|
|
@ -721,7 +721,7 @@ Q82. What does the message "You should specify input for mean/scale values" mean
|
|||
#####################################################################################################################################################
|
||||
|
||||
**A:** When the model has multiple inputs and you want to provide mean/scale values, you need to pass those values for each input. More specifically, the number of passed values should be the same as the number of inputs of the model.
|
||||
For more information, refer to the :doc:`Converting a Model to Intermediate Representation <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
For more information, refer to the :doc:`Converting a Model to Intermediate Representation <[legacy]-setting-input-shapes>` guide.
|
||||
|
||||
.. _question-83:
|
||||
|
||||
|
|
@ -729,7 +729,7 @@ Q83. What does the message "Input with name ... not found!" mean?
|
|||
#####################################################################################################################################################
|
||||
|
||||
**A:** When you passed the mean/scale values and specify names of input layers of the model, you might have used the name that does not correspond to any input layer. Make sure that you list only names of the input layers of your model when passing values with the ``--input`` option.
|
||||
For more information, refer to the :doc:`Converting a Model to Intermediate Representation <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
For more information, refer to the :doc:`Converting a Model to Intermediate Representation <[legacy]-setting-input-shapes>` guide.
|
||||
|
||||
.. _question-84:
|
||||
|
||||
|
|
@ -752,7 +752,7 @@ Q86. What does the message "Operation ... not supported. Please register it as c
|
|||
|
||||
**A:** Model Optimizer tried to load the model that contains some unsupported operations.
|
||||
If you want to convert model that contains unsupported operations, you need to prepare extension for all such operations.
|
||||
For more information, refer to the :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>` guide.
|
||||
For more information, refer to the :doc:`OpenVINO Extensibility Mechanism <../../../openvino-extensibility>` guide.
|
||||
|
||||
.. _question-87:
|
||||
|
||||
|
|
@ -809,7 +809,7 @@ Note that the first call ``register_caffe_python_extractor(ProposalPythonExample
|
|||
|
||||
The second call prevents Model Optimizer from using this extension as if it is an extension for
|
||||
a layer with type ``Proposal``. Otherwise, this layer can be chosen as an implementation of extension that can lead to potential issues.
|
||||
For more information, refer to the :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>` guide.
|
||||
For more information, refer to the :doc:`OpenVINO Extensibility Mechanism <../../../openvino-extensibility>` guide.
|
||||
|
||||
.. _question-88:
|
||||
|
||||
|
|
@ -862,7 +862,7 @@ Q93. What does the message "For legacy MXNet models Model Optimizer does not sup
|
|||
lower than 1.0.0, Model Optimizer does not support such topologies. If you want to convert it, you have to rebuild
|
||||
MXNet with unsupported layers or generate a new JSON file with Apache MXNet version 1.0.0 or higher. You also need to implement
|
||||
OpenVINO extension to use custom layers.
|
||||
For more information, refer to the :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>` guide.
|
||||
For more information, refer to the :doc:`OpenVINO Extensibility Mechanism <../../../openvino-extensibility>` guide.
|
||||
|
||||
.. _question-94:
|
||||
|
||||
|
|
@ -887,12 +887,12 @@ There are multiple ways to avoid cycles:
|
|||
|
||||
For Tensorflow:
|
||||
|
||||
* :doc:`Convert models, created with TensorFlow Object Detection API <openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_Object_Detection_API_Models>`
|
||||
* :doc:`Convert models, created with TensorFlow Object Detection API <[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-tensorflow-object-detection>`
|
||||
|
||||
For all frameworks:
|
||||
|
||||
1. :doc:`Replace cycle containing Sub-graph in Model Optimizer [Legacy Solution] <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`
|
||||
2. See :doc:`OpenVINO Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>`
|
||||
1. :doc:`Replace cycle containing Sub-graph in Model Optimizer [Legacy Solution] <../legacy-model-optimizer-extensibility>`
|
||||
2. See :doc:`OpenVINO Extensibility Mechanism <../../../openvino-extensibility>`
|
||||
|
||||
or
|
||||
|
||||
|
|
@ -916,7 +916,7 @@ Q101. What does the message "Mean/scale values should ..." mean?
|
|||
#####################################################################################################################################################
|
||||
|
||||
**A:** It means that your mean/scale values have a wrong format. Specify mean/scale values in the form of ``layer_name(val1,val2,val3)``.
|
||||
You need to specify values for each input of the model. For more information, refer to the :doc:`Converting a Model to Intermediate Representation <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
You need to specify values for each input of the model. For more information, refer to the :doc:`Converting a Model to Intermediate Representation <[legacy]-setting-input-shapes>` guide.
|
||||
|
||||
.. _question-102:
|
||||
|
||||
|
|
@ -930,7 +930,7 @@ Q102. What does the message "Operation _contrib_box_nms is not supported ..." me
|
|||
Q103. What does the message "ModelOptimizer is not able to parse *.caffemodel" mean?
|
||||
#####################################################################################################################################################
|
||||
|
||||
**A:** If a ``*.caffemodel`` file exists and is correct, the error occurred possibly because of the use of Python protobuf implementation. In some cases, error messages may appear during model parsing, for example: "``utf-8`` codec can't decode byte 0xe0 in position 4: invalid continuation byte in field: mo_caffe.SpatialTransformerParameter.transform_type". You can either use a newer Python version (3.8 - 3.11) or build the ``cpp`` implementation of ``protobuf`` yourself for your version of Python. For the complete instructions about building ``protobuf`` from sources, see the appropriate section in the :doc:`Converting Models with Model Optimizer <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` guide.
|
||||
**A:** If a ``*.caffemodel`` file exists and is correct, the error occurred possibly because of the use of Python protobuf implementation. In some cases, error messages may appear during model parsing, for example: "``utf-8`` codec can't decode byte 0xe0 in position 4: invalid continuation byte in field: mo_caffe.SpatialTransformerParameter.transform_type". You can either use a newer Python version (3.8 - 3.11) or build the ``cpp`` implementation of ``protobuf`` yourself for your version of Python. For the complete instructions about building ``protobuf`` from sources, see the appropriate section in the :doc:`Converting Models with Model Optimizer <../legacy-conversion-api>` guide.
|
||||
|
||||
.. _question-104:
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Setting Input Shapes <openvino_docs_OV_Converter_UG_prepare_model_convert_model_Converting_Model>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Setting Input Shapes <../../../../openvino-workflow/model-preparation/setting-input-shapes>` article.
|
||||
|
||||
With model conversion API you can increase your model's efficiency by providing an additional shape definition, with these two parameters: `input_shape` and `static_shape`.
|
||||
|
||||
|
|
@ -24,11 +24,11 @@ However, if the shape of data is not going to change from one inference request
|
|||
it is recommended to set up static shapes (when all dimensions are fully defined) for the inputs.
|
||||
Doing it at this stage, instead of during inference in runtime, can be beneficial in terms of performance and memory consumption.
|
||||
To set up static shapes, model conversion API provides the ``input_shape`` parameter.
|
||||
For more information on input shapes under runtime, refer to the :doc:`Changing input shapes <openvino_docs_OV_UG_ShapeInference>` guide.
|
||||
To learn more about dynamic shapes in runtime, refer to the :doc:`Dynamic Shapes <openvino_docs_OV_UG_DynamicShapes>` guide.
|
||||
For more information on input shapes under runtime, refer to the :doc:`Changing input shapes <../../../../openvino-workflow/running-inference/changing-input-shape>` guide.
|
||||
To learn more about dynamic shapes in runtime, refer to the :doc:`Dynamic Shapes <../../../../openvino-workflow/running-inference/dynamic-shapes>` guide.
|
||||
|
||||
The OpenVINO Runtime API may present certain limitations in inferring models with undefined dimensions on some hardware.
|
||||
In this case, the ``input_shape`` parameter and the :doc:`reshape method <openvino_docs_OV_UG_ShapeInference>` can help to resolve undefined dimensions.
|
||||
In this case, the ``input_shape`` parameter and the :doc:`reshape method <../../../../openvino-workflow/running-inference/changing-input-shape>` can help to resolve undefined dimensions.
|
||||
|
||||
For example, run model conversion for the TensorFlow MobileNet model with the single input
|
||||
and specify the input shape of ``[2,300,300,3]``:
|
||||
|
|
@ -147,12 +147,12 @@ For example, launch model conversion for the ONNX OCR model and specify a bounda
|
|||
|
||||
Practically, some models are not ready for input shapes change.
|
||||
In this case, a new input shape cannot be set via model conversion API.
|
||||
For more information about shape follow the :doc:`inference troubleshooting <troubleshooting_reshape_errors>`
|
||||
For more information about shape follow the :doc:`inference troubleshooting <[legacy]-troubleshooting-reshape-errors>`
|
||||
and :ref:`ways to relax shape inference flow <how-to-fix-non-reshape-able-model>` guides.
|
||||
|
||||
Additional Resources
|
||||
####################
|
||||
|
||||
* :doc:`Convert a Model <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>`
|
||||
* :doc:`Cutting Off Parts of a Model <openvino_docs_MO_DG_prepare_model_convert_model_Cutting_Model>`
|
||||
* :doc:`Convert a Model <../legacy-conversion-api>`
|
||||
* :doc:`Cutting Off Parts of a Model <[legacy]-cutting-parts-of-a-model>`
|
||||
|
||||
|
|
|
|||
|
|
@ -7,24 +7,24 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Supported Model Formats <openvino_docs_model_processing_introduction>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Supported Model Formats <../../../../openvino-workflow/model-preparation>` article.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
Converting a TensorFlow Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>
|
||||
Converting an ONNX Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>
|
||||
Converting a PyTorch Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_PyTorch>
|
||||
Converting a TensorFlow Lite Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow_Lite>
|
||||
Converting a PaddlePaddle Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle>
|
||||
Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>
|
||||
Converting a TensorFlow Model <[legacy]-supported-model-formats/[legacy]-convert-tensorflow>
|
||||
Converting an ONNX Model <[legacy]-supported-model-formats/[legacy]-convert-onnx>
|
||||
Converting a PyTorch Model <[legacy]-supported-model-formats/[legacy]-convert-pytorch>
|
||||
Converting a TensorFlow Lite Model <[legacy]-supported-model-formats/[legacy]-convert-tensorflow-lite>
|
||||
Converting a PaddlePaddle Model <[legacy]-supported-model-formats/[legacy]-convert-paddle>
|
||||
Model Conversion Tutorials <[legacy]-supported-model-formats/[legacy]-conversion-tutorials>
|
||||
|
||||
.. meta::
|
||||
:description: Learn about supported model formats and the methods used to convert, read, and compile them in OpenVINO™.
|
||||
|
||||
|
||||
**OpenVINO IR (Intermediate Representation)** - the proprietary and default format of OpenVINO, benefiting from the full extent of its features. All other supported model formats, as listed below, are converted to :doc:`OpenVINO IR <openvino_ir>` to enable inference. Consider storing your model in this format to minimize first-inference latency, perform model optimization, and, in some cases, save space on your drive.
|
||||
**OpenVINO IR (Intermediate Representation)** - the proprietary and default format of OpenVINO, benefiting from the full extent of its features. All other supported model formats, as listed below, are converted to :doc:`OpenVINO IR <../../../openvino-ir-format>` to enable inference. Consider storing your model in this format to minimize first-inference latency, perform model optimization, and, in some cases, save space on your drive.
|
||||
|
||||
**PyTorch, TensorFlow, ONNX, and PaddlePaddle** - can be used with OpenVINO Runtime API directly,
|
||||
which means you do not need to save them as OpenVINO IR before including them in your application.
|
||||
|
|
@ -36,7 +36,7 @@ The ``convert_model()`` method enables you to perform additional adjustments
|
|||
to the model, such as setting shapes, changing model input types or layouts,
|
||||
cutting parts of the model, freezing inputs, etc. For a detailed description
|
||||
of the conversion process, see the
|
||||
:doc:`model conversion guide <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>`.
|
||||
:doc:`model conversion guide <../legacy-conversion-api>`.
|
||||
|
||||
Here are code examples of how to use these methods with different model formats:
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_PyTorch>`
|
||||
:doc:`guide <[legacy]-supported-model-formats/[legacy]-convert-pytorch>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/102-pytorch-onnx-to-openvino-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>`
|
||||
:doc:`guide <[legacy]-supported-model-formats/[legacy]-convert-tensorflow>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/101-tensorflow-to-openvino-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
:doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
.. tab-item:: C++
|
||||
:sync: cpp
|
||||
|
|
@ -153,7 +153,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
ov::CompiledModel compiled_model = core.compile_model("saved_model.pb", "AUTO");
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
:doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
.. tab-item:: C
|
||||
:sync: c
|
||||
|
|
@ -174,7 +174,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
ov_core_compile_model_from_file(core, "saved_model.pb", "AUTO", 0, &compiled_model);
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
:doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
|
@ -186,7 +186,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
mo --input_model <INPUT_MODEL>.pb
|
||||
|
||||
For details on the conversion, refer to the
|
||||
:doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>`.
|
||||
:doc:`article <[legacy]-supported-model-formats/[legacy]-convert-tensorflow>`.
|
||||
|
||||
.. tab-item:: TensorFlow Lite
|
||||
:sync: tflite
|
||||
|
|
@ -213,7 +213,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>`
|
||||
:doc:`guide <[legacy]-supported-model-formats/[legacy]-convert-tensorflow>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/119-tflite-to-openvino-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
compiled_model = core.compile_model("<INPUT_MODEL>.tflite", "AUTO")
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
:doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
|
||||
.. tab-item:: C++
|
||||
|
|
@ -265,7 +265,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
ov::CompiledModel compiled_model = core.compile_model("<INPUT_MODEL>.tflite", "AUTO");
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
:doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
.. tab-item:: C
|
||||
:sync: c
|
||||
|
|
@ -284,7 +284,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
ov_core_compile_model_from_file(core, "<INPUT_MODEL>.tflite", "AUTO", 0, &compiled_model);
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
:doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
|
@ -304,7 +304,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
mo --input_model <INPUT_MODEL>.tflite
|
||||
|
||||
For details on the conversion, refer to the
|
||||
:doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow_Lite>`.
|
||||
:doc:`article <[legacy]-supported-model-formats/[legacy]-convert-tensorflow-lite>`.
|
||||
|
||||
.. tab-item:: ONNX
|
||||
:sync: onnx
|
||||
|
|
@ -331,7 +331,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>`
|
||||
:doc:`guide <[legacy]-supported-model-formats/[legacy]-convert-onnx>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/102-pytorch-onnx-to-openvino-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
|
|
@ -363,7 +363,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
|
||||
compiled_model = core.compile_model("<INPUT_MODEL>.onnx", "AUTO")
|
||||
|
||||
For a guide on how to run inference, see how to :doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
For a guide on how to run inference, see how to :doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
|
||||
.. tab-item:: C++
|
||||
|
|
@ -381,7 +381,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
|
||||
ov::CompiledModel compiled_model = core.compile_model("<INPUT_MODEL>.onnx", "AUTO");
|
||||
|
||||
For a guide on how to run inference, see how to :doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
For a guide on how to run inference, see how to :doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
.. tab-item:: C
|
||||
:sync: c
|
||||
|
|
@ -399,7 +399,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
ov_compiled_model_t* compiled_model = NULL;
|
||||
ov_core_compile_model_from_file(core, "<INPUT_MODEL>.onnx", "AUTO", 0, &compiled_model);
|
||||
|
||||
For details on the conversion, refer to the :doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>`
|
||||
For details on the conversion, refer to the :doc:`article <[legacy]-supported-model-formats/[legacy]-convert-onnx>`
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
|
@ -419,7 +419,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
mo --input_model <INPUT_MODEL>.onnx
|
||||
|
||||
For details on the conversion, refer to the
|
||||
:doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>`
|
||||
:doc:`article <[legacy]-supported-model-formats/[legacy]-convert-onnx>`
|
||||
|
||||
.. tab-item:: PaddlePaddle
|
||||
:sync: pdpd
|
||||
|
|
@ -452,7 +452,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle>`
|
||||
:doc:`guide <[legacy]-supported-model-formats/[legacy]-convert-paddle>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/103-paddle-to-openvino-classification-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
|
|
@ -484,7 +484,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
compiled_model = core.compile_model("<INPUT_MODEL>.pdmodel", "AUTO")
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
:doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
.. tab-item:: C++
|
||||
:sync: cpp
|
||||
|
|
@ -502,7 +502,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
ov::CompiledModel compiled_model = core.compile_model("<INPUT_MODEL>.pdmodel", "AUTO");
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
:doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
.. tab-item:: C
|
||||
:sync: c
|
||||
|
|
@ -521,7 +521,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
ov_core_compile_model_from_file(core, "<INPUT_MODEL>.pdmodel", "AUTO", 0, &compiled_model);
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
:doc:`Integrate OpenVINO™ with Your Application <../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>`.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
|
@ -541,7 +541,7 @@ Here are code examples of how to use these methods with different model formats:
|
|||
mo --input_model <INPUT_MODEL>.pdmodel
|
||||
|
||||
For details on the conversion, refer to the
|
||||
:doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle>`.
|
||||
:doc:`article <[legacy]-supported-model-formats/[legacy]-convert-paddle>`.
|
||||
|
||||
|
||||
As OpenVINO support for **MXNet, Caffe, and Kaldi formats** has been **discontinued**, converting these legacy formats
|
||||
|
|
@ -550,7 +550,7 @@ to OpenVINO IR or ONNX before running inference should be considered the default
|
|||
.. note::
|
||||
|
||||
If you want to keep working with the legacy formats the old way, refer to a previous
|
||||
`OpenVINO LTS version and its documentation <https://docs.openvino.ai/2022.3/Supported_Model_Formats.html>`__ .
|
||||
`OpenVINO LTS version and its ../../../../documentation <https://docs.openvino.ai/2022.3/Supported_Model_Formats.html>`__ .
|
||||
|
||||
OpenVINO versions of 2023 are mostly compatible with the old instructions,
|
||||
through a deprecated MO tool, installed with the deprecated OpenVINO Developer Tools package.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_MO_DG_prepare_model_convert_model_tutorials}
|
||||
.. {#openvino_docs_MO_DG_prepare_model_convert_model_../../../../../learn-openvino/interactive-tutorials-python}
|
||||
|
||||
[LEGACY] Model Conversion Tutorials
|
||||
====================================================
|
||||
|
|
@ -8,31 +8,31 @@
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_AttentionOCR_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_BERT_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_CRNN_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_DeepSpeech_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_EfficientDet_Models
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_FaceNet_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_GNMT_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_lm_1b_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_NCF_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_Object_Detection_API_Models
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_RetinaNet_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_Slim_Library_Models
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_WideAndDeep_Family_Models
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_XLNet_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_YOLO_From_Tensorflow
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_Faster_RCNN
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_GPT2
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_Mask_RCNN
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_Bert_ner
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_Cascade_RCNN_res101
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_F3Net
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_QuartzNet
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_RCAN
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_RNNT
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_YOLACT
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-attention-ocr
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-bert
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-crnn
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-deep-speech
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-efficient-det
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-face-net
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-gnmt
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-language-1b
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-ncf
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-object-detection
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-retina-net
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-slim-library
|
||||
[legacy]-conversion-tutorials/convert-tensroflow-wide-and-deep-family
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-xlnet
|
||||
[legacy]-conversion-tutorials/convert-tensorflow-yolo
|
||||
[legacy]-conversion-tutorials/convert-onnx-faster-r-cnn
|
||||
[legacy]-conversion-tutorials/convert-onnx-gpt-2
|
||||
[legacy]-conversion-tutorials/convert-onnx-mask-r-cnn
|
||||
[legacy]-conversion-tutorials/convert-pytorch-bert-ner
|
||||
[legacy]-conversion-tutorials/convert-pytorch-cascade-rcnn-r-101
|
||||
[legacy]-conversion-tutorials/convert-pytorch-f3-net
|
||||
[legacy]-conversion-tutorials/convert-pytorch-quartz-net
|
||||
[legacy]-conversion-tutorials/convert-pytorch-rcan
|
||||
[legacy]-conversion-tutorials/convert-pytorch-rnn-t
|
||||
[legacy]-conversion-tutorials/convert-pytorch-yolact
|
||||
|
||||
|
||||
.. meta::
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
The code described in the tutorials has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../learn-openvino/interactive-tutorials-python <../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
This section provides a set of tutorials that demonstrate conversion methods for specific
|
||||
TensorFlow, ONNX, and PyTorch models. Note that these instructions do not cover all use
|
||||
|
|
@ -55,7 +55,7 @@ Before studying the tutorials, try to convert the model out-of-the-box by specif
|
|||
|
||||
Apache MXNet, Caffe, and Kaldi are no longer directly supported by OpenVINO.
|
||||
|
||||
You will find a collection of :doc:`Python tutorials <tutorials>` written for running on Jupyter notebooks
|
||||
You will find a collection of :doc:`Python ../../../../../learn-openvino/interactive-tutorials-python <../../../../../learn-openvino/interactive-tutorials-python>` written for running on Jupyter notebooks
|
||||
that provide an introduction to the OpenVINO™ toolkit and explain how to use the Python API and tools for
|
||||
optimized deep learning inference.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting an ONNX Faster R-CNN Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
The instructions below are applicable **only** to the Faster R-CNN model converted to the ONNX file format from the `maskrcnn-benchmark model <https://github.com/facebookresearch/maskrcnn-benchmark>`__:
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting an ONNX GPT-2 Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
`Public pre-trained GPT-2 model <https://github.com/onnx/models/tree/master/text/machine_comprehension/gpt-2>`__ is a large
|
||||
transformer-based language model with a simple objective: predict the next word, given all of the previous words within some text.
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting an ONNX Mask R-CNN Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
The instructions below are applicable **only** to the Mask R-CNN model converted to the ONNX file format from the `maskrcnn-benchmark model <https://github.com/facebookresearch/maskrcnn-benchmark>`__.
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ The instructions below are applicable **only** to the Mask R-CNN model converted
|
|||
--transformations_config front/onnx/mask_rcnn.json
|
||||
|
||||
|
||||
Be aware that the height and width specified with the ``input_shape`` command line parameter could be different. For more information about supported input image dimensions and required pre- and post-processing steps, refer to the `documentation <https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/mask-rcnn>`__.
|
||||
Be aware that the height and width specified with the ``input_shape`` command line parameter could be different. For more information about supported input image dimensions and required pre- and post-processing steps, refer to the `../../../../../../documentation <https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/mask-rcnn>`__.
|
||||
|
||||
3. Interpret the outputs of the generated IR file: masks, class indices, probabilities and box coordinates:
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting a PyTorch BERT-NER Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
The goal of this article is to present a step-by-step guide on how to convert PyTorch BERT-NER model to OpenVINO IR. First, you need to download the model and convert it to ONNX.
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting a PyTorch Cascade RCNN R-101 Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
The goal of this article is to present a step-by-step guide on how to convert a PyTorch Cascade RCNN R-101 model to OpenVINO IR. First, you need to download the model and convert it to ONNX.
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ Downloading and Converting Model to ONNX
|
|||
|
||||
.. note::
|
||||
|
||||
To set up an environment, refer to the `instructions <https://github.com/open-mmlab/mmdetection/blob/master/docs/en/get_started.md#installation>`__.
|
||||
To set up an environment, refer to the `instructions <https://github.com/open-mmlab/mmdetection/blob/master/docs/en/../../../../../../get-started.md#installation>`__.
|
||||
|
||||
* Download the pre-trained `model <https://download.openmmlab.com/mmdetection/v2.0/cascade_rcnn/cascade_rcnn_r101_fpn_1x_coco/cascade_rcnn_r101_fpn_1x_coco_20200317-0b6a2fbf.pth>`__. The model is also available `here <https://github.com/open-mmlab/mmdetection/blob/master/configs/cascade_rcnn/README.md>`__.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting a PyTorch F3Net Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
`F3Net <https://github.com/weijun88/F3Net>`__ : Fusion, Feedback and Focus for Salient Object Detection
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting a PyTorch QuartzNet Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
`NeMo project <https://github.com/NVIDIA/NeMo>`__ provides the QuartzNet model.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting a PyTorch RCAN Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
`RCAN <https://github.com/yulunzhang/RCAN>`__ : Image Super-Resolution Using Very Deep Residual Channel Attention Networks
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting a PyTorch RNN-T Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
This guide covers conversion of RNN-T model from `MLCommons <https://github.com/mlcommons>`__ repository. Follow
|
||||
the instructions below to export a PyTorch model into ONNX, before converting it to IR:
|
||||
|
|
@ -134,6 +134,6 @@ After completing this step, the files ``rnnt_encoder.onnx``, ``rnnt_prediction.o
|
|||
|
||||
.. note::
|
||||
|
||||
The hardcoded value for sequence length = 157 was taken from the MLCommons, but conversion to IR preserves network :doc:`reshapeability <openvino_docs_OV_UG_ShapeInference>`. Therefore, input shapes can be changed manually to any value during either conversion or inference.
|
||||
The hardcoded value for sequence length = 157 was taken from the MLCommons, but conversion to IR preserves network :doc:`reshapeability <../../../../../../openvino-workflow/running-inference/changing-input-shape>`. Therefore, input shapes can be changed manually to any value during either conversion or inference.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting a PyTorch YOLACT Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
You Only Look At CoefficienTs (YOLACT) is a simple, fully convolutional model for real-time instance segmentation.
|
||||
The PyTorch implementation is publicly available in `this GitHub repository <https://github.com/dbolya/yolact>`__.
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Converting a TensorFlow Attention OCR Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
This tutorial explains how to convert the Attention OCR (AOCR) model from the `TensorFlow Attention OCR repository <https://github.com/emedvedev/attention-ocr>`__ to the Intermediate Representation (IR).
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting a TensorFlow BERT Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
Pretrained models for BERT (Bidirectional Encoder Representations from Transformers) are
|
||||
`publicly available <https://github.com/google-research/bert>`__.
|
||||
|
|
@ -166,7 +166,7 @@ Follow these steps to make a pretrained TensorFlow BERT model reshapable over ba
|
|||
--input_model inference_graph.pb \
|
||||
--input "IteratorGetNext:0{i32}[1,128],IteratorGetNext:1{i32}[1,128],IteratorGetNext:4{i32}[1,128]"
|
||||
|
||||
For other applicable parameters, refer to the :doc:`Convert Model from TensorFlow <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` guide.
|
||||
For other applicable parameters, refer to the :doc:`Convert Model from TensorFlow <../[legacy]-convert-tensorflow>` guide.
|
||||
|
||||
For more information about reshape abilities, refer to the :doc:`Using Shape Inference <openvino_docs_OV_UG_ShapeInference>` guide.
|
||||
For more information about reshape abilities, refer to the :doc:`Using Shape Inference <../../../../../../openvino-workflow/running-inference/changing-input-shape>` guide.
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting a TensorFlow CRNN Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
This tutorial explains how to convert a CRNN model to OpenVINO™ Intermediate Representation (IR).
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting a TensorFlow DeepSpeech Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
`DeepSpeech project <https://github.com/mozilla/DeepSpeech>`__ provides an engine to train speech-to-text models.
|
||||
|
||||
|
|
@ -72,12 +72,12 @@ There are two specificities with the supported part of the model.
|
|||
|
||||
The first is that the model contains an input with sequence length. So the model can be converted with
|
||||
a fixed input length shape, thus the model is not reshapable.
|
||||
Refer to the :doc:`Using Shape Inference <openvino_docs_OV_UG_ShapeInference>` guide.
|
||||
Refer to the :doc:`Using Shape Inference <../../../../../../openvino-workflow/running-inference/changing-input-shape>` guide.
|
||||
|
||||
The second is that the frozen model still has two variables: ``previous_state_c`` and ``previous_state_h``, figure
|
||||
with the frozen *.pb model is below. It means that the model keeps training these variables at each inference.
|
||||
|
||||
.. image:: ./_static/images/DeepSpeech-0.8.2.png
|
||||
.. image:: ./../../../../../../_static/images/DeepSpeech-0.8.2.png
|
||||
|
||||
At the first inference, the variables are initialized with zero tensors. After execution, the results of the ``BlockLSTM``
|
||||
are assigned to cell state and hidden state, which are these two variables.
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting TensorFlow EfficientDet Models
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
This tutorial explains how to convert EfficientDet public object detection models to the Intermediate Representation (IR).
|
||||
|
||||
|
|
@ -53,10 +53,10 @@ The attribute ``image_size`` specifies the shape to be defined for the model con
|
|||
|
||||
.. note::
|
||||
|
||||
The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the ``RGB<->BGR`` conversion specifying the command-line parameter: ``--reverse_input_channels``. Otherwise, inference results may be incorrect. For more information about the parameter, refer to the **When to Reverse Input Channels** section of the :doc:`Converting a Model to Intermediate Representation (IR) <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the ``RGB<->BGR`` conversion specifying the command-line parameter: ``--reverse_input_channels``. Otherwise, inference results may be incorrect. For more information about the parameter, refer to the **When to Reverse Input Channels** section of the :doc:`Converting a Model to Intermediate Representation (IR) <../../[legacy]-setting-input-shapes>` guide.
|
||||
|
||||
OpenVINO toolkit provides samples that can be used to infer EfficientDet model.
|
||||
For more information, refer to the :doc:`Open Model Zoo Demos <omz_demos>`.
|
||||
For more information, refer to the :doc:`Open Model Zoo Demos <../../../../../../omz_demos>`.
|
||||
|
||||
Interpreting Results of the TensorFlow Model and the IR
|
||||
#######################################################
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting TensorFlow FaceNet Models
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Supported Model Formats <openvino_docs_model_processing_introduction>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Supported Model Formats <../../../../../../openvino-workflow/model-preparation>` article.
|
||||
|
||||
`Public pre-trained FaceNet models <https://github.com/davidsandberg/facenet#pre-trained-models>`__ contain both training
|
||||
and inference part of graph. Switch between this two states is manageable with placeholder value.
|
||||
|
|
@ -21,7 +21,7 @@ Intermediate Representation (IR) models are intended for inference, which means
|
|||
There are two inputs in this network: boolean ``phase_train`` which manages state of the graph (train/infer) and
|
||||
``batch_size`` which is a part of batch joining pattern.
|
||||
|
||||
.. image:: ./_static/images/FaceNet.svg
|
||||
.. image:: ./../../../../../../_static/images/FaceNet.svg
|
||||
|
||||
Converting a TensorFlow FaceNet Model to the IR
|
||||
###############################################
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting a TensorFlow GNMT Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
This tutorial explains how to convert Google Neural Machine Translation (GNMT) model to the Intermediate Representation (IR).
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ Output cutting:
|
|||
|
||||
* ``LookupTableFindV2`` operation is cut from the output and the ``dynamic_seq2seq/decoder/decoder/GatherTree`` node is treated as a new exit point.
|
||||
|
||||
For more information about model cutting, refer to the :doc:`Cutting Off Parts of a Model <openvino_docs_MO_DG_prepare_model_convert_model_Cutting_Model>` guide.
|
||||
For more information about model cutting, refer to the :doc:`Cutting Off Parts of a Model <../../[legacy]-cutting-parts-of-a-model>` guide.
|
||||
|
||||
Using a GNMT Model
|
||||
##################
|
||||
|
|
@ -313,5 +313,5 @@ Running GNMT IR
|
|||
result_ie = exec_net.infer(input_data)
|
||||
|
||||
|
||||
For more information about Python API, refer to the :doc:`OpenVINO Runtime Python API <api/ie_python_api/api>` guide.
|
||||
For more information about Python API, refer to the :doc:`OpenVINO Runtime Python API <../../../../../../api/ie_python_api/api>` guide.
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting a TensorFlow Language Model on One Billion Word Benchmark
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
Downloading a Pre-trained Language Model on One Billion Word Benchmark
|
||||
######################################################################
|
||||
|
|
@ -92,7 +92,7 @@ Once you have downloaded the pretrained model files, you will have the ``lm_1b``
|
|||
|
||||
|
||||
|
||||
.. image:: ./_static/images/lm_1b.svg
|
||||
.. image:: ./../../../../../../_static/images/lm_1b.svg
|
||||
|
||||
The frozen model still has two variables: ``Variable`` and ``Variable_1``.
|
||||
It means that the model keeps training those variables at each inference.
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting a TensorFlow Neural Collaborative Filtering Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
This tutorial explains how to convert Neural Collaborative Filtering (NCF) model to the OpenVINO Intermediate Representation.
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ This tutorial explains how to convert Neural Collaborative Filtering (NCF) model
|
|||
|
||||
1. Use `the instructions <https://github.com/tensorflow/models/tree/master/official/recommendation#train-and-evaluate-model>`__ from this repository to train the model.
|
||||
|
||||
2. Freeze the inference graph you get in the previous step in ``model_dir``, following the instructions from the **Freezing Custom Models in Python** section of the :doc:`Converting a TensorFlow Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` guide.
|
||||
2. Freeze the inference graph you get in the previous step in ``model_dir``, following the instructions from the **Freezing Custom Models in Python** section of the :doc:`Converting a TensorFlow Model <../[legacy]-convert-tensorflow>` guide.
|
||||
|
||||
Run the following commands:
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ This tutorial explains how to convert Neural Collaborative Filtering (NCF) model
|
|||
|
||||
3. Convert the model to the OpenVINO format. If you look at your frozen model, you can see that it has one input that is split into four ``ResourceGather`` layers. (Click image to zoom in.)
|
||||
|
||||
.. image:: ./_static/images/NCF_start.svg
|
||||
.. image:: ./../../../../../../_static/images/NCF_start.svg
|
||||
|
||||
However, as the model conversion API does not support such data feeding, you should skip it. Cut
|
||||
the edges incoming in ``ResourceGather`` port 1:
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ Converting TensorFlow Object Detection API Models
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
* Starting with the 2022.1 release, model conversion API can convert the TensorFlow Object Detection API Faster and Mask RCNNs topologies differently. By default, model conversion adds operation "Proposal" to the generated IR. This operation needs an additional input to the model with name "image_info" which should be fed with several values describing the preprocessing applied to the input image (refer to the :doc:`Proposal <openvino_docs_ops_detection_Proposal_4>` operation specification for more information). However, this input is redundant for the models trained and inferred with equal size images. Model conversion API can generate IR for such models and insert operation :doc:`DetectionOutput <openvino_docs_ops_detection_DetectionOutput_1>` instead of ``Proposal``. The `DetectionOutput` operation does not require additional model input "image_info". Moreover, for some models the produced inference results are closer to the original TensorFlow model. In order to trigger new behavior, the attribute "operation_to_add" in the corresponding JSON transformation configuration file should be set to value "DetectionOutput" instead of default one "Proposal".
|
||||
* Starting with the 2021.1 release, model conversion API converts the TensorFlow Object Detection API SSDs, Faster and Mask RCNNs topologies keeping shape-calculating sub-graphs by default, so topologies can be re-shaped in the OpenVINO Runtime using dedicated reshape API. Refer to the :doc:`Using Shape Inference <openvino_docs_OV_UG_ShapeInference>` guide for more information on how to use this feature. It is possible to change the both spatial dimensions of the input image and batch size.
|
||||
* Starting with the 2022.1 release, model conversion API can convert the TensorFlow Object Detection API Faster and Mask RCNNs topologies differently. By default, model conversion adds operation "Proposal" to the generated IR. This operation needs an additional input to the model with name "image_info" which should be fed with several values describing the preprocessing applied to the input image (refer to the :doc:`Proposal <../../../../../openvino-ir-format/operation-sets/operations-specifications/detection/proposal-4>` operation specification for more information). However, this input is redundant for the models trained and inferred with equal size images. Model conversion API can generate IR for such models and insert operation :doc:`DetectionOutput <../../../../../openvino-ir-format/operation-sets/operations-specifications/detection/detectionoutput-1>` instead of ``Proposal``. The `DetectionOutput` operation does not require additional model input "image_info". Moreover, for some models the produced inference results are closer to the original TensorFlow model. In order to trigger new behavior, the attribute "operation_to_add" in the corresponding JSON transformation configuration file should be set to value "DetectionOutput" instead of default one "Proposal".
|
||||
* Starting with the 2021.1 release, model conversion API converts the TensorFlow Object Detection API SSDs, Faster and Mask RCNNs topologies keeping shape-calculating sub-graphs by default, so topologies can be re-shaped in the OpenVINO Runtime using dedicated reshape API. Refer to the :doc:`Using Shape Inference <../../../../../../openvino-workflow/running-inference/changing-input-shape>` guide for more information on how to use this feature. It is possible to change the both spatial dimensions of the input image and batch size.
|
||||
* To generate IRs for TF 1 SSD topologies, model conversion API creates a number of ``PriorBoxClustered`` operations instead of a constant node with prior boxes calculated for the particular input image size. This change allows you to reshape the topology in the OpenVINO Runtime using dedicated API. The reshaping is supported for all SSD topologies except FPNs, which contain hardcoded shapes for some operations preventing from changing topology input shape.
|
||||
|
||||
Converting a Model
|
||||
|
|
@ -27,7 +27,7 @@ You can download TensorFlow Object Detection API models from the `TensorFlow 1 D
|
|||
|
||||
.. note::
|
||||
|
||||
Before converting, make sure you have configured model conversion API. For configuration steps, refer to the :doc:`Convert a Model <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>`.
|
||||
Before converting, make sure you have configured model conversion API. For configuration steps, refer to the :doc:`Convert a Model <../../../legacy-conversion-api>`.
|
||||
|
||||
To convert a TensorFlow Object Detection API model, run the ``mo`` command with the following required parameters:
|
||||
|
||||
|
|
@ -67,9 +67,9 @@ To convert a TensorFlow Object Detection API model, run the ``mo`` command with
|
|||
|
||||
.. note::
|
||||
|
||||
The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the ``RGB<->BGR`` conversion specifying the command-line parameter: ``reverse_input_channels``. Otherwise, inference results may be incorrect. If you convert a TensorFlow Object Detection API model to use with the OpenVINO sample applications, you must specify the ``reverse_input_channels`` parameter. For more information about the parameter, refer to the **When to Reverse Input Channels** section of the :doc:`Converting a Model to Intermediate Representation (IR) <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the ``RGB<->BGR`` conversion specifying the command-line parameter: ``reverse_input_channels``. Otherwise, inference results may be incorrect. If you convert a TensorFlow Object Detection API model to use with the OpenVINO sample applications, you must specify the ``reverse_input_channels`` parameter. For more information about the parameter, refer to the **When to Reverse Input Channels** section of the :doc:`Converting a Model to Intermediate Representation (IR) <../../[legacy]-setting-input-shapes>` guide.
|
||||
|
||||
Additionally to the mandatory parameters listed above you can use optional conversion parameters if needed. A full list of parameters is available in the :doc:`Converting a TensorFlow Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` guide.
|
||||
Additionally to the mandatory parameters listed above you can use optional conversion parameters if needed. A full list of parameters is available in the :doc:`Converting a TensorFlow Model <../[legacy]-convert-tensorflow>` guide.
|
||||
|
||||
For example, if you downloaded the pre-trained `SSD InceptionV2 topology <http://download.tensorflow.org/models/object_detection/ssd_inception_v2_coco_2018_01_28.tar.gz>`__ and extracted archive to the directory ``/tmp/ssd_inception_v2_coco_2018_01_28``, the sample command line to convert the model looks as follows:
|
||||
|
||||
|
|
@ -86,8 +86,8 @@ Open Model Zoo provides set of demo applications to show implementation of close
|
|||
based on deep learning in various tasks, including Image Classification, Visual Object Detection, Text Recognition,
|
||||
Speech Recognition, Natural Language Processing and others. Refer to the links below for more details.
|
||||
|
||||
* :doc:`OpenVINO Samples <openvino_docs_OV_UG_Samples_Overview>`
|
||||
* :doc:`Open Model Zoo Demos <model_zoo>`
|
||||
* :doc:`OpenVINO Samples <../../../../../../learn-openvino/openvino-samples>`
|
||||
* :doc:`Open Model Zoo Demos <../../../../model-zoo>`
|
||||
|
||||
Feeding Input Images to the Samples
|
||||
###################################
|
||||
|
|
@ -169,7 +169,7 @@ Models with ``keep_aspect_ratio_resizer`` were trained to recognize object in re
|
|||
Model Conversion Process in Detail
|
||||
##################################
|
||||
|
||||
This section is intended for users who want to understand how model conversion API performs Object Detection API models conversion in details. The information in this section is also useful for users having complex models that are not converted with model conversion API out of the box. It is highly recommended to read the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>` documentation first to understand sub-graph replacement concepts which are used here.
|
||||
This section is intended for users who want to understand how model conversion API performs Object Detection API models conversion in details. The information in this section is also useful for users having complex models that are not converted with model conversion API out of the box. It is highly recommended to read the **Graph Transformation Extensions** section in the :doc:`[Legacy] Model Optimizer Extensibility <../../../legacy-model-optimizer-extensibility>` ../../../../../../documentation first to understand sub-graph replacement concepts which are used here.
|
||||
|
||||
It is also important to open the model in the `TensorBoard <https://www.tensorflow.org/guide/summaries_and_tensorboard>`__ to see the topology structure. Model conversion API can create an event file that can be then fed to the TensorBoard tool. Run model conversion, providing two command line parameters:
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting a TensorFlow RetinaNet Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
This tutorial explains how to convert a RetinaNet model to the Intermediate Representation (IR).
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting TensorFlow Slim Image Classification Model Library Models
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
`TensorFlow-Slim Image Classification Model Library <https://github.com/tensorflow/models/tree/master/research/slim/README.md>`__ is a library to define, train and evaluate classification models in TensorFlow. The library contains Python scripts defining the classification topologies together with checkpoint files for several pre-trained classification topologies. To convert a TensorFlow-Slim library model, complete the following steps:
|
||||
|
||||
|
|
@ -115,5 +115,5 @@ OpenVINO classification sample reads an input image as a three-dimensional array
|
|||
|
||||
Similarly, the mean/scale values can be determined for other Slim models.
|
||||
|
||||
The exact mean/scale values are defined in the table with list of supported TensorFlow-Slim models at the :doc:`Converting a TensorFlow Model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` guide.
|
||||
The exact mean/scale values are defined in the table with list of supported TensorFlow-Slim models at the :doc:`Converting a TensorFlow Model <../[legacy]-convert-tensorflow>` guide.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting a TensorFlow XLNet Model
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
Pretrained models for XLNet (Bidirectional Encoder Representations from Transformers) are
|
||||
`publicly available <https://github.com/zihangdai/xlnet>`__.
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Converting TensorFlow YOLO Models
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
This document explains how to convert real-time object detection YOLOv1, YOLOv2, YOLOv3 and YOLOv4 public models to the Intermediate Representation (IR). All YOLO models are originally implemented in the DarkNet framework and consist of two files:
|
||||
|
||||
|
|
@ -208,10 +208,10 @@ where:
|
|||
|
||||
.. note::
|
||||
|
||||
The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the ``RGB<->BGR`` conversion specifying the command-line parameter: ``reverse_input_channels``. Otherwise, inference results may be incorrect. For more information about the parameter, refer to the **When to Reverse Input Channels** section of the :doc:`Converting a Model to Intermediate Representation (IR) <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the ``RGB<->BGR`` conversion specifying the command-line parameter: ``reverse_input_channels``. Otherwise, inference results may be incorrect. For more information about the parameter, refer to the **When to Reverse Input Channels** section of the :doc:`Converting a Model to Intermediate Representation (IR) <../../[legacy]-setting-input-shapes>` guide.
|
||||
|
||||
|
||||
OpenVINO toolkit provides a demo that uses YOLOv3 model. Refer to the :doc:`Object Detection C++ Demo <omz_demos_object_detection_demo_cpp>` for more information.
|
||||
OpenVINO toolkit provides a demo that uses YOLOv3 model. Refer to the :doc:`Object Detection C++ Demo <../../../../../../omz_demos_object_detection_demo_cpp>` for more information.
|
||||
|
||||
Converting YOLOv1 and YOLOv2 Models to the IR
|
||||
#############################################
|
||||
|
|
@ -308,10 +308,10 @@ where:
|
|||
|
||||
* ``batch`` defines shape of model input. In the example, ``batch`` is equal to 1, but you can also specify other integers larger than 1.
|
||||
* ``scale`` specifies scale factor that input values will be divided by. The model was trained with input values in the range ``[0,1]``. OpenVINO toolkit samples read input images as values in ``[0,255]`` range, so the scale 255 must be applied.
|
||||
* ``transformations_config`` adds missing ``Region`` layers to the model. In the IR, the ``Region`` layer has name ``RegionYolo``. For other applicable parameters, refer to the :doc:`Convert Model from TensorFlow <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` guide.
|
||||
* ``transformations_config`` adds missing ``Region`` layers to the model. In the IR, the ``Region`` layer has name ``RegionYolo``. For other applicable parameters, refer to the :doc:`Convert Model from TensorFlow <../[legacy]-convert-tensorflow>` guide.
|
||||
|
||||
.. note::
|
||||
|
||||
The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the ``RGB<->BGR`` conversion specifying the command-line parameter: ``reverse_input_channels``. Otherwise, inference results may be incorrect. For more information about the parameter, refer to the **When to Reverse Input Channels** section of the :doc:`Converting a Model to Intermediate Representation (IR) <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
The color channel order (RGB or BGR) of an input data should match the channel order of the model training dataset. If they are different, perform the ``RGB<->BGR`` conversion specifying the command-line parameter: ``reverse_input_channels``. Otherwise, inference results may be incorrect. For more information about the parameter, refer to the **When to Reverse Input Channels** section of the :doc:`Converting a Model to Intermediate Representation (IR) <../../[legacy]-setting-input-shapes>` guide.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Converting TensorFlow Wide and Deep Family Models
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <tutorials>`.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python ../../../../../../learn-openvino/interactive-tutorials-python <../../../../../../learn-openvino/interactive-tutorials-python>`.
|
||||
|
||||
The Wide and Deep models is a combination of wide and deep parts for memorization and generalization of object features respectively.
|
||||
These models can contain different types of object features such as numerical, categorical, sparse and sequential features. These feature types are specified
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting an ONNX Model <openvino_docs_OV_Converter_UG_prepare_model_convert_model_Convert_Model_From_ONNX>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting an ONNX Model <../../../../../openvino-workflow/model-preparation/convert-model-onnx>` article.
|
||||
|
||||
|
||||
.. note:: ONNX models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <openvino_docs_OV_UG_Integrate_OV_with_your_application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
.. note:: ONNX models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <../../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
|
||||
Converting an ONNX Model
|
||||
########################
|
||||
|
|
@ -49,20 +49,20 @@ The model conversion process assumes you have an ONNX model that was directly do
|
|||
mo --input_model <INPUT_MODEL>.onnx
|
||||
|
||||
|
||||
There are no ONNX-specific parameters, so only framework-agnostic parameters are available to convert your model. For details, see the *General Conversion Parameters* section in the :doc:`Converting a Model to Intermediate Representation (IR) <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
There are no ONNX-specific parameters, so only framework-agnostic parameters are available to convert your model. For details, see the *General Conversion Parameters* section in the :doc:`Converting a Model to Intermediate Representation (IR) <../[legacy]-setting-input-shapes>` guide.
|
||||
|
||||
Supported ONNX Layers
|
||||
#####################
|
||||
|
||||
For the list of supported standard layers, refer to the :doc:`Supported Operations <openvino_resources_supported_operations_frontend>` page.
|
||||
For the list of supported standard layers, refer to the :doc:`Supported Operations <../../../../../about-openvino/compatibility-and-support/supported-operations-framework-frontend>` page.
|
||||
|
||||
Additional Resources
|
||||
####################
|
||||
|
||||
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific ONNX models. Here are some examples:
|
||||
See the :doc:`Model Conversion Tutorials <[legacy]-conversion-tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific ONNX models. Here are some examples:
|
||||
|
||||
* :doc:`Convert ONNX Faster R-CNN Model <openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_Faster_RCNN>`
|
||||
* :doc:`Convert ONNX GPT-2 Model <openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_GPT2>`
|
||||
* :doc:`Convert ONNX Mask R-CNN Model <openvino_docs_MO_DG_prepare_model_convert_model_onnx_specific_Convert_Mask_RCNN>`
|
||||
* :doc:`Convert ONNX Faster R-CNN Model <[legacy]-conversion-tutorials/convert-onnx-faster-r-cnn>`
|
||||
* :doc:`Convert ONNX GPT-2 Model <[legacy]-conversion-tutorials/convert-onnx-gpt-2>`
|
||||
* :doc:`Convert ONNX Mask R-CNN Model <[legacy]-conversion-tutorials/convert-onnx-mask-r-cnn>`
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,17 +13,17 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting a PaddlePaddle Model <openvino_docs_OV_Converter_UG_prepare_model_convert_model_Convert_Model_From_Paddle>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting a PaddlePaddle Model <../../../../../openvino-workflow/model-preparation/convert-model-paddle>` article.
|
||||
|
||||
|
||||
This page provides general instructions on how to convert a model from a PaddlePaddle format to the OpenVINO IR format using Model Optimizer. The instructions are different depending on PaddlePaddle model format.
|
||||
|
||||
.. note:: PaddlePaddle models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <openvino_docs_OV_UG_Integrate_OV_with_your_application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
.. note:: PaddlePaddle models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <../../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
|
||||
Converting PaddlePaddle Model Inference Format
|
||||
##############################################
|
||||
|
||||
PaddlePaddle inference model includes ``.pdmodel`` (storing model structure) and ``.pdiparams`` (storing model weight). For how to export PaddlePaddle inference model, please refer to the `Exporting PaddlePaddle Inference Model <https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/model_save_load_cn.html>`__ Chinese guide.
|
||||
PaddlePaddle inference model includes ``.pdmodel`` (storing model structure) and ``.pdiparams`` (storing model weight). For how to export PaddlePaddle inference model, please refer to the `Exporting PaddlePaddle Inference Model <https://www.paddlepaddle.org.cn/../../../../../documentation/docs/zh/develop/guides/beginner/model_save_load_cn.html>`__ Chinese guide.
|
||||
|
||||
|
||||
To convert a PaddlePaddle model, use the ``mo`` script and specify the path to the input ``.pdmodel`` model file:
|
||||
|
|
@ -126,16 +126,16 @@ When you convert certain PaddlePaddle models, you may need to set the ``example_
|
|||
Supported PaddlePaddle Layers
|
||||
#############################
|
||||
|
||||
For the list of supported standard layers, refer to the :doc:`Supported Operations <openvino_resources_supported_operations_frontend>` page.
|
||||
For the list of supported standard layers, refer to the :doc:`Supported Operations <../../../../../about-openvino/compatibility-and-support/supported-operations-framework-frontend>` page.
|
||||
|
||||
Frequently Asked Questions (FAQ)
|
||||
################################
|
||||
|
||||
The model conversion API displays explanatory messages for typographical errors, incorrectly used options, or other issues. They describe the potential cause of the problem and give a link to the :doc:`Model Optimizer FAQ <openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ>`, which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections in :doc:`Convert a Model <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` to help you understand what went wrong.
|
||||
The model conversion API displays explanatory messages for typographical errors, incorrectly used options, or other issues. They describe the potential cause of the problem and give a link to the :doc:`Model Optimizer FAQ <../[legacy]-model-optimizer-faq>`, which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections in :doc:`Convert a Model <../../legacy-conversion-api>` to help you understand what went wrong.
|
||||
|
||||
Additional Resources
|
||||
####################
|
||||
|
||||
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific PaddlePaddle models.
|
||||
See the :doc:`Model Conversion Tutorials <[legacy]-conversion-tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific PaddlePaddle models.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting a PyTorch Model <openvino_docs_OV_Converter_UG_prepare_model_convert_model_Convert_Model_From_PyTorch>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting a PyTorch Model <../../../../../openvino-workflow/model-preparation/convert-model-pytorch>` article.
|
||||
|
||||
This page provides instructions on how to convert a model from the PyTorch format to the OpenVINO IR format.
|
||||
|
||||
The conversion is a required step to run inference using OpenVINO API.
|
||||
It is not required if you choose to work with OpenVINO under the PyTorch framework,
|
||||
using its :doc:`torch.compile feature <pytorch_2_0_torch_compile>`.
|
||||
using its :doc:`torch.compile feature <../../../../../openvino-workflow/torch-compile>`.
|
||||
|
||||
Converting a PyTorch model with PyTorch Frontend
|
||||
###############################################################
|
||||
|
|
@ -66,7 +66,7 @@ parameter to be set, for example:
|
|||
|
||||
Sometimes ``convert_model`` will produce inputs of the model with dynamic rank or dynamic type.
|
||||
Such model may not be supported by the hardware chosen for inference. To avoid this issue,
|
||||
use the ``input`` argument of ``convert_model``. For more information, refer to :doc:`Convert Models Represented as Python Objects <openvino_docs_MO_DG_Python_API>`.
|
||||
use the ``input`` argument of ``convert_model``. For more information, refer to :doc:`Convert Models Represented as Python Objects <../[legacy]-convert-models-as-python-objects>`.
|
||||
|
||||
.. important::
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ Exporting a PyTorch Model to ONNX Format
|
|||
It is also possible to export a PyTorch model to ONNX and then convert it to OpenVINO IR. To convert and deploy a PyTorch model this way, follow these steps:
|
||||
|
||||
1. `Export a PyTorch model to ONNX <#exporting-a-pytorch-model-to-onnx-format>`__.
|
||||
2. :doc:`Convert an ONNX model <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>` to produce an optimized :doc:`Intermediate Representation <openvino_docs_MO_DG_IR_and_opsets>` of the model based on the trained network topology, weights, and biases values.
|
||||
2. :doc:`Convert an ONNX model <[legacy]-convert-onnx>` to produce an optimized :doc:`Intermediate Representation <../../../../openvino-ir-format/operation-sets>` of the model based on the trained network topology, weights, and biases values.
|
||||
|
||||
PyTorch models are defined in Python. To export them, use the ``torch.onnx.export()`` method. The code to
|
||||
evaluate or test the model is usually provided with its code and can be used for its initialization and export.
|
||||
|
|
@ -105,9 +105,9 @@ To export a PyTorch model, you need to obtain the model as an instance of ``torc
|
|||
Additional Resources
|
||||
####################
|
||||
|
||||
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific PyTorch models. Here are some examples:
|
||||
See the :doc:`Model Conversion Tutorials <[legacy]-conversion-tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific PyTorch models. Here are some examples:
|
||||
|
||||
* :doc:`Convert PyTorch BERT-NER Model <openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_Bert_ner>`
|
||||
* :doc:`Convert PyTorch RCAN Model <openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_RCAN>`
|
||||
* :doc:`Convert PyTorch YOLACT Model <openvino_docs_MO_DG_prepare_model_convert_model_pytorch_specific_Convert_YOLACT>`
|
||||
* :doc:`Convert PyTorch BERT-NER Model <[legacy]-conversion-tutorials/convert-pytorch-bert-ner>`
|
||||
* :doc:`Convert PyTorch RCAN Model <[legacy]-conversion-tutorials/convert-pytorch-rcan>`
|
||||
* :doc:`Convert PyTorch YOLACT Model <[legacy]-conversion-tutorials/convert-pytorch-yolact>`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow_Lite}
|
||||
.. {#[legacy]-convert-tensorflow_Lite}
|
||||
|
||||
[LEGACY] Converting a TensorFlow Lite Model
|
||||
=====================================================
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting a TensorFlow Lite Model <openvino_docs_OV_Converter_UG_prepare_model_convert_model_Convert_Model_From_TensorFlow_Lite>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting a TensorFlow Lite Model <../../../../../openvino-workflow/model-preparation/convert-model-tensorflow-lite>` article.
|
||||
|
||||
To convert a TensorFlow Lite model, use the ``mo`` script and specify the path to the input ``.tflite`` model file:
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ To convert a TensorFlow Lite model, use the ``mo`` script and specify the path t
|
|||
|
||||
mo --input_model <INPUT_MODEL>.tflite
|
||||
|
||||
TensorFlow Lite models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <openvino_docs_OV_UG_Integrate_OV_with_your_application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
TensorFlow Lite models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <../../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
|
||||
.. important::
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ TensorFlow Lite models are supported via FrontEnd API. You may skip conversion t
|
|||
Supported TensorFlow Lite Layers
|
||||
###################################
|
||||
|
||||
For the list of supported standard layers, refer to the :doc:`Supported Operations <openvino_resources_supported_operations_frontend>` page.
|
||||
For the list of supported standard layers, refer to the :doc:`Supported Operations <../../../../../about-openvino/compatibility-and-support/supported-operations-framework-frontend>` page.
|
||||
|
||||
Supported TensorFlow Lite Models
|
||||
###################################
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting a TensorFlow Model <openvino_docs_OV_Converter_UG_prepare_model_convert_model_Convert_Model_From_TensorFlow>` article.
|
||||
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Converting a TensorFlow Model <../../../../../openvino-workflow/model-preparation/convert-model-tensorflow>` article.
|
||||
|
||||
|
||||
.. note:: TensorFlow models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <openvino_docs_OV_UG_Integrate_OV_with_your_application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
.. note:: TensorFlow models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <../../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
|
||||
The conversion instructions are different depending on whether your model was created with TensorFlow v1.X or TensorFlow v2.X.
|
||||
|
||||
|
|
@ -311,12 +311,12 @@ Model conversion API supports passing TensorFlow/TensorFlow2 models directly fro
|
|||
Supported TensorFlow and TensorFlow 2 Keras Layers
|
||||
##################################################
|
||||
|
||||
For the list of supported standard layers, refer to the :doc:`Supported Operations <openvino_resources_supported_operations_frontend>` page.
|
||||
For the list of supported standard layers, refer to the :doc:`Supported Operations <../../../../../about-openvino/compatibility-and-support/supported-operations-framework-frontend>` page.
|
||||
|
||||
Frequently Asked Questions (FAQ)
|
||||
################################
|
||||
|
||||
The model conversion API provides explanatory messages if it is unable to run to completion due to typographical errors, incorrectly used options, or other issues. The message describes the potential cause of the problem and gives a link to the :doc:`Model Optimizer FAQ <openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ>`. The FAQ provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections in :doc:`Convert a Model <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` to help you understand what went wrong.
|
||||
The model conversion API provides explanatory messages if it is unable to run to completion due to typographical errors, incorrectly used options, or other issues. The message describes the potential cause of the problem and gives a link to the :doc:`Model Optimizer FAQ <../[legacy]-model-optimizer-faq>`. The FAQ provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections in :doc:`Convert a Model <../../legacy-conversion-api>` to help you understand what went wrong.
|
||||
|
||||
Summary
|
||||
#######
|
||||
|
|
@ -331,9 +331,9 @@ In this document, you learned:
|
|||
Additional Resources
|
||||
####################
|
||||
|
||||
See the :doc:`Model Conversion Tutorials <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>` page for a set of tutorials providing step-by-step instructions for converting specific TensorFlow models. Here are some examples:
|
||||
See the :doc:`Model Conversion Tutorials <[legacy]-conversion-tutorials>` page for a set of ../../../../../learn-openvino/interactive-tutorials-python providing step-by-step instructions for converting specific TensorFlow models. Here are some examples:
|
||||
|
||||
* :doc:`Convert TensorFlow EfficientDet Models <openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_EfficientDet_Models>`
|
||||
* :doc:`Convert TensorFlow FaceNet Models <openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_FaceNet_From_Tensorflow>`
|
||||
* :doc:`Convert TensorFlow Object Detection API Models <openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_Object_Detection_API_Models>`
|
||||
* :doc:`Convert TensorFlow EfficientDet Models <[legacy]-conversion-tutorials/convert-tensorflow-efficient-det>`
|
||||
* :doc:`Convert TensorFlow FaceNet Models <[legacy]-conversion-tutorials/convert-tensorflow-face-net>`
|
||||
* :doc:`Convert TensorFlow Object Detection API Models <[legacy]-conversion-tutorials/convert-tensorflow-object-detection>`
|
||||
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ Operation semantics may impose restrictions on input shapes of the operation.
|
|||
Shape collision during shape propagation may be a sign that new shape does not satisfy the restrictions.
|
||||
Changing the model input shape may result in intermediate operations shape collision. For example, in the following:
|
||||
|
||||
* The :doc:`Reshape <openvino_docs_ops_shape_Reshape_1>` operation with a hard-coded output shape value,
|
||||
* The :doc:`MatMul <openvino_docs_ops_matrix_MatMul_1>` operation with the ``Const`` second input and this input cannot be resized by spatial dimensions due to operation semantics.
|
||||
* The :doc:`Reshape <../../../openvino-ir-format/operation-sets/operations-specifications/shape/reshape-1>` operation with a hard-coded output shape value,
|
||||
* The :doc:`MatMul <../../../openvino-ir-format/operation-sets/operations-specifications/matrix/matmul-1>` operation with the ``Const`` second input and this input cannot be resized by spatial dimensions due to operation semantics.
|
||||
|
||||
Model structure and logic should not change significantly after model reshaping.
|
||||
|
||||
|
|
@ -46,11 +46,11 @@ To fix some operators which prevent normal shape propagation:
|
|||
|
||||
With ``1:reshaped[2]``, it is required to cut the second input (counting from zero, so ``1:`` means the second input) of the operation named ``reshaped`` and replace it with a ``Parameter`` with shape ``[2]``.
|
||||
With ``->[0 -1]``, this new ``Parameter`` is replaced by a ``Constant`` operator which has the ``[0, -1]`` value.
|
||||
Since the ``Reshape`` operator has ``0`` and ``-1`` as specific values, it allows propagating shapes freely without losing the intended meaning of ``Reshape``. For more information, see :doc:`the specification <openvino_docs_ops_shape_Reshape_1>`.
|
||||
Since the ``Reshape`` operator has ``0`` and ``-1`` as specific values, it allows propagating shapes freely without losing the intended meaning of ``Reshape``. For more information, see :doc:`the specification <../../../openvino-ir-format/operation-sets/operations-specifications/shape/reshape-1>`.
|
||||
|
||||
.. image:: _static/images/batch_relaxation.png
|
||||
.. image:: ../../../../_static/images/batch_relaxation.png
|
||||
|
||||
* transform the model conversion on the back phase. For more information, see the :doc:`How to Convert a Model <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`,
|
||||
* transform OpenVINO Model during the runtime. For more information, see :doc:`OpenVINO Runtime Transformations <openvino_docs_transformations>`,
|
||||
* transform the model conversion on the back phase. For more information, see the :doc:`How to Convert a Model <../legacy-model-optimizer-extensibility>`,
|
||||
* transform OpenVINO Model during the runtime. For more information, see :doc:`OpenVINO Runtime Transformations <../../../openvino-extensibility/transformations-api>`,
|
||||
* modify the original model with the help of the original framework.
|
||||
|
||||
|
|
|
|||
|
|
@ -9,30 +9,30 @@ Legacy Model Optimizer Extensibility
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections
|
||||
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions
|
||||
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Extending_Model_Optimizer_With_Caffe_Python_Layers
|
||||
legacy-model-optimizer-extensibility/[legacy]-graph-traversal-and-modification
|
||||
legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions
|
||||
legacy-model-optimizer-extensibility/[legacy]-extending-model-optimizer-with-caffe-python-layers
|
||||
|
||||
.. danger::
|
||||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <openvino_docs_Extensibility_UG_Frontend_Extensions>` article.
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <../../openvino-extensibility/frontend-extensions>` article.
|
||||
|
||||
This article describes Model Optimizer internals. Altering them may result in application instability, and in case of future changes to the API, lack of backward compatibility.
|
||||
|
||||
.. note::
|
||||
If you want to add support for ONNX, TensorFlow Lite, PaddlePaddle or TensorFlow operations, or you are not familiar with other extension alternatives in OpenVINO, read :doc:`this guide <openvino_docs_Extensibility_UG_Intro>` instead.
|
||||
If you want to add support for ONNX, TensorFlow Lite, PaddlePaddle or TensorFlow operations, or you are not familiar with other extension alternatives in OpenVINO, read :doc:`this guide <../../openvino-extensibility>` instead.
|
||||
|
||||
.. _model-optimizer-extensibility:
|
||||
|
||||
Model Optimizer extensibility mechanism enables support of new operations and custom transformations to generate the optimized intermediate representation (IR) as described :doc:`here <openvino_docs_MO_DG_IR_and_opsets>`.
|
||||
Model Optimizer extensibility mechanism enables support of new operations and custom transformations to generate the optimized intermediate representation (IR) as described :doc:`here <../../openvino-ir-format/operation-sets>`.
|
||||
This mechanism is a core part of Model Optimizer, as a huge set of examples showing how to add custom logic to support your model.
|
||||
|
||||
There are several cases when the customization is needed:
|
||||
|
||||
* A model contains operation(s) not known for the Model Optimizer, but these operation(s) could be expressed as a combination of supported operations. In this case, a custom transformation should be implemented to replace unsupported operation(s) with supported ones.
|
||||
* A model contains a sub-graph of operations that can be replaced with a smaller number of operations to get better performance. This example corresponds to so-called *fusing transformations* (e.g., replacing a sub-graph performing the calculation :math:`x/(1.0+e^{-(beta*x)})` with a single operation of type :doc:`Swish <openvino_docs_ops_activation_Swish_4>`.
|
||||
* A model contains a sub-graph of operations that can be replaced with a smaller number of operations to get better performance. This example corresponds to so-called *fusing transformations* (e.g., replacing a sub-graph performing the calculation :math:`x/(1.0+e^{-(beta*x)})` with a single operation of type :doc:`Swish <../../openvino-ir-format/operation-sets/operations-specifications/activation/swish-4>`.
|
||||
* A model contains a custom framework operation (the operation that is not a part of an official operation set of the framework) that was developed using the framework extensibility mechanism. In this case, Model Optimizer should know how to handle the operation and generate a corresponding section in an IR for it.
|
||||
|
||||
It is necessary to figure out how Model Optimizer represents a model in a memory and converts it to an IR before
|
||||
|
|
@ -59,7 +59,7 @@ dictionary, and provides many convenient methods to work with the node. For exam
|
|||
name ``my_attr`` can be retrieved from the node with the following code ``my_node.my_attr``, which is equivalent to obtaining
|
||||
attribute with name ``my_attr`` in the ``graph.node[my_node]`` dictionary. For the class implementation details, refer to the ``mo/graph/graph.py`` file.
|
||||
|
||||
An operation may have several inputs and outputs. For example, operation :doc:`Split <openvino_docs_ops_movement_Split_1>` has
|
||||
An operation may have several inputs and outputs. For example, operation :doc:`Split <../../openvino-ir-format/operation-sets/operations-specifications/movement/split-1>` has
|
||||
two inputs: data to split and axis to split along, and variable number of outputs depending on a value of attribute
|
||||
``num_splits``. Each input data to the operation is passed to a specific operation **input port**. An operation produces
|
||||
the output data from an **output port**. Input and output ports are numbered from 0 independently. Model Optimizer uses
|
||||
|
|
@ -73,7 +73,7 @@ edge attributes if needed. Meanwhile, most manipulations with nodes connections
|
|||
is strongly not recommended.
|
||||
|
||||
Further details and examples related to a model representation in memory are provided in the sections below, in a context
|
||||
for a better explanation. For more information on how to use ports and connections, refer to the :doc:`Graph Traversal and Modification Using Ports and Connections <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections>` article.
|
||||
for a better explanation. For more information on how to use ports and connections, refer to the :doc:`Graph Traversal and Modification Using Ports and Connections <legacy-model-optimizer-extensibility/[legacy]-graph-traversal-and-modification>` article.
|
||||
|
||||
.. _mo_model_conversion_pipeline:
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ Model Conversion Pipeline
|
|||
|
||||
A model conversion pipeline can be represented with the following diagram:
|
||||
|
||||
.. image:: _static/images/MO_conversion_pipeline.svg
|
||||
.. image:: ../../../_static/images/MO_conversion_pipeline.svg
|
||||
|
||||
Each conversion step is reviewed in details below.
|
||||
|
||||
|
|
@ -96,16 +96,16 @@ is a separate loader for each supported framework. These loaders are implemented
|
|||
``extensions/load/<FRAMEWORK>/loader.py`` files of Model Optimizer.
|
||||
|
||||
.. note::
|
||||
Model Optimizer uses a special parser for Caffe models built on top of the ``caffe.proto`` file. In the case of a model loading failure, Model Optimizer throws an error and requests preparation of the parser that can read the model. For more information on how to prepare the custom Caffe parser, refer to the :ref:`question #1 <question-1>` in the :doc:`Model Optimizer FAQ <openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ>`.
|
||||
Model Optimizer uses a special parser for Caffe models built on top of the ``caffe.proto`` file. In the case of a model loading failure, Model Optimizer throws an error and requests preparation of the parser that can read the model. For more information on how to prepare the custom Caffe parser, refer to the :ref:`question #1 <question-1>` in the :doc:`Model Optimizer FAQ <legacy-conversion-api/[legacy]-model-optimizer-faq>`.
|
||||
|
||||
The result of a model loading step is a ``Graph`` object, which can be depicted like in the following example:
|
||||
|
||||
.. image:: _static/images/MO_graph_after_loader.svg
|
||||
.. image:: ../../../_static/images/MO_graph_after_loader.svg
|
||||
|
||||
Model Optimizer loader saves an operation instance framework description (usually it is a Protobuf message) into a node
|
||||
attribute usually with a name ``pb`` for each operation of an input model. It is important that this is a
|
||||
**framework-specific** description of an operation. This means that an operation (e.g.
|
||||
:doc:`Convolution <openvino_docs_ops_convolution_Convolution_1>` may be represented differently in, for example, Caffe and
|
||||
:doc:`Convolution <../../openvino-ir-format/operation-sets/operations-specifications/convolution/convolution-1>` may be represented differently in, for example, Caffe and
|
||||
TensorFlow frameworks but performs the same calculations from a mathematical point of view.
|
||||
|
||||
In the image above, the **Operation 2** has one input and two outputs. The tensor produced from the output **port 0** is
|
||||
|
|
@ -123,7 +123,7 @@ Operations Attributes Extracting
|
|||
The next step is to parse framework-dependent operation representation saved in a node attribute and update the node
|
||||
attributes with the operation specific attributes. There are three options to do this.
|
||||
|
||||
1. The extractor extension approach (recommended way to extract attributes for an operation). Explained in details in the :doc:`Operation Extractor <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Extractor>` article.
|
||||
1. The extractor extension approach (recommended way to extract attributes for an operation). Explained in details in the :doc:`Operation Extractor <legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions/[legacy]-optimizer-extractor>` article.
|
||||
2. The legacy approach with a built-in extractor. The ``mo/front/<FRAMEWORK>/extractor.py`` file (for example, the one for Caffe) defines a dictionary with extractors for specific operation types. A key in the dictionary is a type of an operation to trigger the extracting function for and the value is the function. The function has one parameter – a node to extract attributes from. This is a legacy and non-extensible approach so it should be avoided. This mechanism will be removed in future versions of Model Optimizer.
|
||||
|
||||
The extractors execution order is the following:
|
||||
|
|
@ -134,14 +134,14 @@ The extractors execution order is the following:
|
|||
|
||||
The result of operations attributes extracting step can be depicted like in the following example:
|
||||
|
||||
.. image:: _static/images/MO_graph_after_extractors.svg
|
||||
.. image:: ../../../_static/images/MO_graph_after_extractors.svg
|
||||
|
||||
The only difference in the graph from the previous step is that nodes contain dictionary with extracted attributes and
|
||||
operation-specific attributes needed for Model Optimizer. However, from this step, Model Optimizer does not
|
||||
need the original representation of the operation/model and just uses Model Optimizer representation (there are some
|
||||
peculiar cases in which Model Optimizer still uses the ``pb`` attribute, covered in this
|
||||
article partially). A detailed list of common node attributes and their values is provided in the
|
||||
:doc:`Model Optimizer Operation <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Operation>` article.
|
||||
:doc:`Model Optimizer Operation <legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions/[legacy]-model-optimizer-operation>` article.
|
||||
|
||||
Front Phase
|
||||
###########
|
||||
|
|
@ -156,7 +156,7 @@ During the front phase, Model Optimizer knows shape of the model inputs and cons
|
|||
transformation. For example, the transformation ``extensions/front/TopKNormalize.py`` removes an attribute ``k`` from a
|
||||
``TopK`` node and adds an input constant with the value ``k``. The transformation is needed to convert a ``TopK`` operation.
|
||||
It comes from frameworks, where a number of output elements is defined as an attribute of the operation to the
|
||||
OpenVINO :doc:`TopK <openvino_docs_ops_sort_TopK_3>` operation semantic, which requires this value to be a separate input.
|
||||
OpenVINO :doc:`TopK <../../openvino-ir-format/operation-sets/operations-specifications/sort/top-k-3>` operation semantic, which requires this value to be a separate input.
|
||||
|
||||
It is important to mention that sometimes it seems like transformation cannot be implemented during the front phase
|
||||
because the actual values of inputs or shapes are needed. In fact, manipulations of shapes or values can be implemented
|
||||
|
|
@ -165,12 +165,12 @@ using operations that are added to the graph. Consider the
|
|||
`Flatten <https://github.com/onnx/onnx/blob/master/docs/Operators.md#Flatten>`__ operation with a sub-graph of operations performing
|
||||
the following (when ``axis`` is not equal to 0 and 1):
|
||||
|
||||
1. Calculate a shape of the ``Flatten`` input tensor, using the :doc:`ShapeOf <openvino_docs_ops_shape_ShapeOf_3>` operation.
|
||||
2. Get the first ``axis`` elements from the output of ``Shape`` operation and calculate their product, using the :doc:`ReduceProd <openvino_docs_ops_reduction_ReduceProd_1>` operation.
|
||||
3. Concatenate output of the ``ReduceProd`` and constant with the value of ``-1`` (for an explanation of this value refer to the :doc:`Reshape <openvino_docs_ops_shape_Reshape_1>` specification page).
|
||||
1. Calculate a shape of the ``Flatten`` input tensor, using the :doc:`ShapeOf <../../openvino-ir-format/operation-sets/operations-specifications/shape/shape-of-3>` operation.
|
||||
2. Get the first ``axis`` elements from the output of ``Shape`` operation and calculate their product, using the :doc:`ReduceProd <../../openvino-ir-format/operation-sets/operations-specifications/reduction/reduce-prod-1>` operation.
|
||||
3. Concatenate output of the ``ReduceProd`` and constant with the value of ``-1`` (for an explanation of this value refer to the :doc:`Reshape <../../openvino-ir-format/operation-sets/operations-specifications/shape/reshape-1>` specification page).
|
||||
4. Use the concatenated value as the second input to the ``Reshape`` operation.
|
||||
|
||||
It is highly recommended to write shape-agnostic transformations to avoid model reshape-ability issues. For more information related to the reshaping of a model, refer to the :doc:`Using Shape Inference <openvino_docs_OV_UG_ShapeInference>` guide.
|
||||
It is highly recommended to write shape-agnostic transformations to avoid model reshape-ability issues. For more information related to the reshaping of a model, refer to the :doc:`Using Shape Inference <../../../openvino-workflow/running-inference/changing-input-shape>` guide.
|
||||
|
||||
More information on how to develop front phase transformations and dedicated API description is provided in the
|
||||
:ref:`Front Phase Transformations <mo_front_phase_transformations>`.
|
||||
|
|
@ -183,27 +183,27 @@ Partial Inference
|
|||
Model Optimizer performs a partial inference of a model during model conversion. This procedure includes output shapes
|
||||
calculation of all operations in a model and constant folding (value calculation for constant sub-graphs). The constant
|
||||
folding is needed for the shape inference because in some cases evaluation of constant sub-graph is needed to calculate
|
||||
output shapes. For example, the output shape for the :doc:`Reshape <openvino_docs_ops_shape_Reshape_1>` operation may be
|
||||
defined as a mathematical expression using the :doc:`ShapeOf <openvino_docs_ops_shape_ShapeOf_3>` operation output.
|
||||
output shapes. For example, the output shape for the :doc:`Reshape <../../openvino-ir-format/operation-sets/operations-specifications/shape/reshape-1>` operation may be
|
||||
defined as a mathematical expression using the :doc:`ShapeOf <../../openvino-ir-format/operation-sets/operations-specifications/shape/shape-of-3>` operation output.
|
||||
|
||||
.. note::
|
||||
Model Optimizer does not fold sub-graphs starting from the :doc:`ShapeOf <openvino_docs_ops_shape_ShapeOf_3>` operation by default because this leads to a model non-reshape-ability (the command-line parameter ``--static_shape`` can override this behavior). For more information related to reshaping of a model, refer to the :doc:`Using Shape Inference <openvino_docs_OV_UG_ShapeInference>` guide.
|
||||
Model Optimizer does not fold sub-graphs starting from the :doc:`ShapeOf <../../openvino-ir-format/operation-sets/operations-specifications/shape/shape-of-3>` operation by default because this leads to a model non-reshape-ability (the command-line parameter ``--static_shape`` can override this behavior). For more information related to reshaping of a model, refer to the :doc:`Using Shape Inference <../../../openvino-workflow/running-inference/changing-input-shape>` guide.
|
||||
|
||||
Model Optimizer calculates output shapes for all operations in a model to write them to Intermediate Representation files.
|
||||
|
||||
.. note::
|
||||
This is a legacy requirement. Starting with IR version 10, OpenVINO Runtime needs to know shapes of the :doc:`Const <openvino_docs_ops_infrastructure_Constant_1>` and the :doc:`Parameter <openvino_docs_ops_infrastructure_Parameter_1>` operations only. The OpenVINO Runtime calculates output shapes for all operations in a model, using shapes of :doc:`Parameter <openvino_docs_ops_infrastructure_Parameter_1>` and :doc:`Const <openvino_docs_ops_infrastructure_Constant_1>` operations defined with respective operation attributes.
|
||||
This is a legacy requirement. Starting with IR version 10, OpenVINO Runtime needs to know shapes of the :doc:`Const <../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/constant-1>` and the :doc:`Parameter <../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/parameter-1>` operations only. The OpenVINO Runtime calculates output shapes for all operations in a model, using shapes of :doc:`Parameter <../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/parameter-1>` and :doc:`Const <../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/constant-1>` operations defined with respective operation attributes.
|
||||
|
||||
Model Optimizer inserts **data** nodes to the computation graph before starting the partial inference phase. The data node
|
||||
corresponds to the specific tensor produced with the operation. Each data node contains two attributes: ``shape``,
|
||||
containing the shape of the tensor, and ``value``, which may contain the actual value of the tensor. The value for a ``value``
|
||||
attribute is equal to ``None`` if this tensor value cannot be calculated. This happens in two cases: when a tensor value
|
||||
depends on a values passed to the :doc:`Parameter <openvino_docs_ops_infrastructure_Parameter_1>` operation of a model or
|
||||
depends on a values passed to the :doc:`Parameter <../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/parameter-1>` operation of a model or
|
||||
Model Optimizer does not have value propagation implementation for the operation.
|
||||
|
||||
Before running partial inference, the graph can be depicted like in the following example:
|
||||
|
||||
.. image:: _static/images/MO_graph_before_partial_inference.svg
|
||||
.. image:: ../../../_static/images/MO_graph_before_partial_inference.svg
|
||||
|
||||
The difference in a graph structure with a graph during the front phase is not only in the data nodes, but also in the
|
||||
edge attributes. Note that an ``out`` attribute is specified for edges **from operation** nodes only, while an ``in``
|
||||
|
|
@ -219,11 +219,11 @@ each node in the graph, according to the topological order. Each node of the gra
|
|||
with a shape inference function, which is a function with one parameter – an instance of the ``Node`` class. The ``infer``
|
||||
attribute is usually set in the operation extractor or when a node is added in some transformation using the Model
|
||||
Optimizer operation class inherited from the ``mo.pos.Op`` class. For more information on how to specify a shape inference function,
|
||||
refer to the :doc:`Model Optimizer Operation <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Operation>` and :doc:`Operation Extractor <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Extractor>` articles.
|
||||
refer to the :doc:`Model Optimizer Operation <legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions/[legacy]-model-optimizer-operation>` and :doc:`Operation Extractor <legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions/[legacy]-optimizer-extractor>` articles.
|
||||
|
||||
A shape inference function should calculate an operation (node) output shape(s) based on input shape(s) and operation
|
||||
(node) attribute(s) and update ``shape`` and optionally ``value`` attributes of the corresponding data node(s). A simplified
|
||||
example of the shape infer function for the :doc:`Reshape <openvino_docs_ops_shape_Reshape_1>` operation (the full version is
|
||||
example of the shape infer function for the :doc:`Reshape <../../openvino-ir-format/operation-sets/operations-specifications/shape/reshape-1>` operation (the full version is
|
||||
available in the ``mo/ops/reshape.py`` file):
|
||||
|
||||
.. code-block:: py
|
||||
|
|
@ -246,7 +246,7 @@ available in the ``mo/ops/reshape.py`` file):
|
|||
node.out_port(0).data.set_shape(output_shape)
|
||||
|
||||
Methods ``in_port()`` and ``output_port()`` of the ``Node`` class are used to get and set data node attributes. For more information on
|
||||
how to use them, refer to the :doc:`Graph Traversal and Modification Using Ports and Connections <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections>` article.
|
||||
how to use them, refer to the :doc:`Graph Traversal and Modification Using Ports and Connections <legacy-model-optimizer-extensibility/[legacy]-graph-traversal-and-modification>` article.
|
||||
|
||||
.. note::
|
||||
A shape inference function should perform output shape calculation in the original model layout. For example, OpenVINO™ supports Convolution operations in NCHW layout only but TensorFlow supports NHWC layout as well. Model Optimizer shape inference function calculates output shapes for NHWC Convolutions in NHWC layout and only during the layout change phase the shape is converted to NCHW.
|
||||
|
|
@ -260,7 +260,7 @@ Middle Phase
|
|||
The middle phase starts after partial inference. At this phase, a graph contains data nodes and output shapes of all
|
||||
operations in the graph have been calculated. Any transformation implemented at this stage must update the ``shape``
|
||||
attribute for all newly added operations. It is highly recommended to use API described in the
|
||||
:doc:`Graph Traversal and Modification Using Ports and Connections <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections>` because modification of a graph using this API causes automatic re-inference of affected nodes as well as necessary data nodes creation.
|
||||
:doc:`Graph Traversal and Modification Using Ports and Connections <legacy-model-optimizer-extensibility/[legacy]-graph-traversal-and-modification>` because modification of a graph using this API causes automatic re-inference of affected nodes as well as necessary data nodes creation.
|
||||
|
||||
More information on how to develop middle transformations and dedicated API description is provided in the
|
||||
:ref:`Middle Phase Transformations <mo_middle_phase_transformations>`.
|
||||
|
|
@ -275,8 +275,8 @@ This layout change is disabled automatically if the model does not have operatio
|
|||
For more details on how it works, refer to the source code of the transformations mentioned in the below summary of the process:
|
||||
|
||||
1. Model Optimizer changes output shapes of most of operations producing 4D and 5D (four dimensional and five dimensional) tensors as if they were in NHWC layout to NCHW layout: ``nchw_shape = np.array(nhwc_shape)[0, 3, 1, 2]`` for 4D and ``nchw_shape = np.array(nhwc_shape)[0, 4, 1, 2, 3]`` for 5D. This permutation does not happen for some operations with specific conditions identified during a model conversion.
|
||||
2. Model Optimizer inserts :doc:`Gather <openvino_docs_ops_movement_Gather_1>` operations to the sub-graph relates to shapes calculation in order to perform shape calculation in a correct layout.
|
||||
3. Model Optimizer inserts :doc:`Transpose <openvino_docs_ops_movement_Transpose_1>` operations for some operations with specific conditions, identified during a model conversion, to produce correct inference results.
|
||||
2. Model Optimizer inserts :doc:`Gather <../../openvino-ir-format/operation-sets/operations-specifications/movement/gather-1>` operations to the sub-graph relates to shapes calculation in order to perform shape calculation in a correct layout.
|
||||
3. Model Optimizer inserts :doc:`Transpose <../../openvino-ir-format/operation-sets/operations-specifications/movement/transpose-1>` operations for some operations with specific conditions, identified during a model conversion, to produce correct inference results.
|
||||
|
||||
The main transformations responsible for a layout change are:
|
||||
|
||||
|
|
@ -292,7 +292,7 @@ Back Phase
|
|||
The back phase starts after the layout change to NCHW. This phase contains mostly the following transformations:
|
||||
|
||||
1. Transformations that should work with a graph in the NCHW layout and thus cannot be implemented in the middle phase.
|
||||
2. Transformations that replace nodes corresponding to internal Model Optimizer operations with nodes corresponding to the :doc:`opset <openvino_docs_ops_opset>` operations.
|
||||
2. Transformations that replace nodes corresponding to internal Model Optimizer operations with nodes corresponding to the :doc:`opset <../../openvino-ir-format/operation-sets/available-opsets>` operations.
|
||||
3. Transformations that normalize operations inputs according to the specification.
|
||||
4. Final optimization transformations.
|
||||
|
||||
|
|
@ -308,21 +308,21 @@ Intermediate Representation Emitting
|
|||
The last phase of a model conversion is the Intermediate Representation emitting. Model Optimizer performs the following
|
||||
steps:
|
||||
|
||||
1. Iterates over all operation nodes in the graph and checks that all nodes have the ``type`` attribute set. This attribute defines the operation type and is used in the OpenVINO to instantiate proper operation from the :doc:`opset <openvino_docs_ops_opset>` specified in the ``version`` attribute of the node. If a node does not have attribute ``type`` or its value is equal to ``None``, Model Optimizer exits with an error.
|
||||
1. Iterates over all operation nodes in the graph and checks that all nodes have the ``type`` attribute set. This attribute defines the operation type and is used in the OpenVINO to instantiate proper operation from the :doc:`opset <../../openvino-ir-format/operation-sets/available-opsets>` specified in the ``version`` attribute of the node. If a node does not have attribute ``type`` or its value is equal to ``None``, Model Optimizer exits with an error.
|
||||
2. Performs type inference of graph operations similar to the shape inference. Inferred data types are saved to a port attributes in the IR.
|
||||
3. Performs topological sort of the graph and changes ``id`` attribute of all operation nodes to be sequential integer values starting from 0.
|
||||
4. Saves all Constants values to the ``.bin`` file. Constants with the same value are shared among different operations.
|
||||
5. Generates an ``.xml`` file defining a graph structure. The information about operation inputs and outputs are prepared uniformly for all operations regardless of their type. A list of attributes to be saved to the ``.xml`` file is defined with the ``backend_attrs()`` or ``supported_attrs()`` of the ``Op`` class used for a graph node instantiation. For more information on how the operation attributes are saved to XML, refer to the function ``prepare_emit_ir()`` in the ``mo/pipeline/common.py`` file and :doc:`Model Optimizer Operation <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Operation>` article.
|
||||
5. Generates an ``.xml`` file defining a graph structure. The information about operation inputs and outputs are prepared uniformly for all operations regardless of their type. A list of attributes to be saved to the ``.xml`` file is defined with the ``backend_attrs()`` or ``supported_attrs()`` of the ``Op`` class used for a graph node instantiation. For more information on how the operation attributes are saved to XML, refer to the function ``prepare_emit_ir()`` in the ``mo/pipeline/common.py`` file and :doc:`Model Optimizer Operation <legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions/[legacy]-model-optimizer-operation>` article.
|
||||
|
||||
====================
|
||||
Additional Resources
|
||||
====================
|
||||
|
||||
* :doc:`Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™ <openvino_docs_MO_DG_IR_and_opsets>`
|
||||
* :doc:`Converting a Model to Intermediate Representation (IR) <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>`
|
||||
* :doc:`OpenVINO Model Representation <openvino_docs_OV_UG_Model_Representation>`
|
||||
* :doc:`OpenVINO™ Extensibility Mechanism <openvino_docs_Extensibility_UG_Intro>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections>`
|
||||
* :doc:`Model Optimizer Extensions <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Extending_Model_Optimizer_With_Caffe_Python_Layers>`
|
||||
* :doc:`Deep Learning Network Intermediate Representation and Operation Sets in OpenVINO™ <../../openvino-ir-format/operation-sets>`
|
||||
* :doc:`Converting a Model to Intermediate Representation (IR) <legacy-conversion-api/[legacy]-setting-input-shapes>`
|
||||
* :doc:`OpenVINO Model Representation <../../../openvino-workflow/running-inference/integrate-openvino-with-your-application/model-representation>`
|
||||
* :doc:`OpenVINO™ Extensibility Mechanism <../../openvino-extensibility>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <legacy-model-optimizer-extensibility/[legacy]-graph-traversal-and-modification>`
|
||||
* :doc:`Model Optimizer Extensions <legacy-model-optimizer-extensibility/[legacy]-model-optimizer-extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <legacy-model-optimizer-extensibility/[legacy]-extending-model-optimizer-with-caffe-python-layers>`
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <openvino_docs_Extensibility_UG_Frontend_Extensions>` article.
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <../../../openvino-extensibility/frontend-extensions>` article.
|
||||
|
||||
This article provides instructions on how to support a custom Caffe operation written only in Python. For example, the
|
||||
`Faster-R-CNN model <https://dl.dropboxusercontent.com/s/o6ii098bu51d139/faster_rcnn_models.tgz?dl=0>`__ implemented in
|
||||
|
|
@ -37,7 +37,7 @@ Caffe contains a custom proposal layer written in Python. The layer is described
|
|||
|
||||
This article describes only a procedure on how to extract operator attributes in Model Optimizer. The rest of the
|
||||
operation enabling pipeline and information on how to support other Caffe operations (written in C++) is described in
|
||||
the :doc:`Customize Model Optimizer <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>` guide.
|
||||
the :doc:`Customize Model Optimizer <../legacy-model-optimizer-extensibility>` guide.
|
||||
|
||||
========================================
|
||||
Writing Extractor for Caffe Python Layer
|
||||
|
|
@ -54,7 +54,7 @@ operation.
|
|||
Below is a simplified example of the extractor for the custom operation Proposal from the mentioned Faster-R-CNN model.
|
||||
The full code with additional checks can be found `here <https://github.com/openvinotoolkit/openvino/blob/releases/2022/1/tools/mo/openvino/tools/mo/front/caffe/proposal_python_ext.py>`__.
|
||||
|
||||
The sample code uses operation ``ProposalOp`` which corresponds to ``Proposal`` operation described in the :doc:`Available Operations Sets <openvino_docs_ops_opset>`
|
||||
The sample code uses operation ``ProposalOp`` which corresponds to ``Proposal`` operation described in the :doc:`Available Operations Sets <../../../openvino-ir-format/operation-sets/available-opsets>`
|
||||
page. For a detailed explanation of the extractor, refer to the source code below.
|
||||
|
||||
.. code-block:: py
|
||||
|
|
@ -106,7 +106,7 @@ page. For a detailed explanation of the extractor, refer to the source code belo
|
|||
Additional Resources
|
||||
====================
|
||||
|
||||
* :doc:`Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections>`
|
||||
* :doc:`Model Optimizer Extensions <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions>`
|
||||
* :doc:`Model Optimizer Extensibility <../legacy-model-optimizer-extensibility>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <[legacy]-graph-traversal-and-modification>`
|
||||
* :doc:`Model Optimizer Extensions <[legacy]-model-optimizer-extensions>`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections}
|
||||
.. {#../legacy-model-optimizer-extensibility_Model_Optimizer_Ports_Connections}
|
||||
|
||||
[LEGACY] Graph Traversal and Modification
|
||||
===========================================
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <openvino_docs_Extensibility_UG_Frontend_Extensions>` article.
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <../../../openvino-extensibility/frontend-extensions>` article.
|
||||
|
||||
There are three APIs for a graph traversal and transformation used in the Model Optimizer:
|
||||
|
||||
|
|
@ -61,9 +61,9 @@ Ports
|
|||
=====
|
||||
|
||||
An operation semantic describes how many inputs and outputs the operation has. For example,
|
||||
:doc:`Parameter <openvino_docs_ops_infrastructure_Parameter_1>` and :doc:`Const <openvino_docs_ops_infrastructure_Constant_1>` operations have no
|
||||
inputs and have one output, :doc:`ReLU <openvino_docs_ops_activation_ReLU_1>` operation has one input and one output,
|
||||
:doc:`Split <openvino_docs_ops_movement_Split_1>` operation has 2 inputs and a variable number of outputs depending on the value of the
|
||||
:doc:`Parameter <../../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/parameter-1>` and :doc:`Const <../../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/constant-1>` operations have no
|
||||
inputs and have one output, :doc:`ReLU <../../../openvino-ir-format/operation-sets/operations-specifications/activation/relu-1>` operation has one input and one output,
|
||||
:doc:`Split <../../../openvino-ir-format/operation-sets/operations-specifications/movement/split-1>` operation has 2 inputs and a variable number of outputs depending on the value of the
|
||||
attribute ``num_splits``.
|
||||
|
||||
Each operation node in the graph (an instance of the ``Node`` class) has 0 or more input and output ports (instances of
|
||||
|
|
@ -71,7 +71,7 @@ the ``mo.graph.port.Port`` class). The ``Port`` object has several attributes:
|
|||
|
||||
* ``node`` - the instance of the ``Node`` object the port belongs to.
|
||||
* ``idx`` - the port number. Input and output ports are numbered independently, starting from ``0``. Thus,
|
||||
:doc:`ReLU <openvino_docs_ops_activation_ReLU_1>` operation has one input port (with index ``0``) and one output port (with index ``0``).
|
||||
:doc:`ReLU <../../../openvino-ir-format/operation-sets/operations-specifications/activation/relu-1>` operation has one input port (with index ``0``) and one output port (with index ``0``).
|
||||
* ``type`` - the type of the port. Could be equal to either ``"in"`` or ``"out"``.
|
||||
* ``data`` - the object that should be used to get attributes of the corresponding data node. This object has methods ``get_shape()`` / ``set_shape()`` and ``get_value()`` / ``set_value()`` to get/set shape/value of the corresponding data node. For example, ``in_port.data.get_shape()`` returns an input shape of a tensor connected to input port ``in_port`` (``in_port.type == 'in'``), ``out_port.data.get_value()`` returns a value of a tensor produced from output port ``out_port`` (``out_port.type == 'out'``).
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ port with ``idx = 2`` corresponds to the incoming edge of a node with an attribu
|
|||
Consider the example of a graph part with 4 operation nodes "Op1", "Op2", "Op3", and "Op4" and a number of data nodes
|
||||
depicted with light green boxes.
|
||||
|
||||
.. image:: _static/images/MO_ports_example_1.svg
|
||||
.. image:: ../../../../_static/images/MO_ports_example_1.svg
|
||||
:scale: 80 %
|
||||
:align: center
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ For example, applying the following two methods to the graph above will result i
|
|||
op4.in_port(1).disconnect()
|
||||
op3.out_port(0).connect(op4.in_port(1))
|
||||
|
||||
.. image:: _static/images/MO_ports_example_2.svg
|
||||
.. image:: ../../../../_static/images/MO_ports_example_2.svg
|
||||
:scale: 80 %
|
||||
:align: center
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ example, the function call ``op3.out_port(0).get_connection().set_source(op1.out
|
|||
consuming data from port ``op3.out_port(0)`` to ``op1.out_port(0)``. The transformed graph from the sample above is depicted
|
||||
below:
|
||||
|
||||
.. image:: _static/images/MO_connection_example_1.svg
|
||||
.. image:: ../../../../_static/images/MO_connection_example_1.svg
|
||||
:scale: 80 %
|
||||
:align: center
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ different.
|
|||
Additional Resources
|
||||
====================
|
||||
|
||||
* :doc:`Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`
|
||||
* :doc:`Model Optimizer Extensions <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Extending_Model_Optimizer_With_Caffe_Python_Layers>`
|
||||
* :doc:`Model Optimizer Extensibility <../legacy-model-optimizer-extensibility>`
|
||||
* :doc:`Model Optimizer Extensions <[legacy]-model-optimizer-extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <[legacy]-extending-model-optimizer-with-caffe-python-layers>`
|
||||
|
||||
|
|
|
|||
|
|
@ -12,22 +12,22 @@
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Operation
|
||||
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Extractor
|
||||
openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Transformation_Extensions
|
||||
[legacy]-model-optimizer-extensions/[legacy]-model-optimizer-operation
|
||||
[legacy]-model-optimizer-extensions/[legacy]-optimizer-extractor
|
||||
[legacy]-model-optimizer-extensions/[legacy]-graph-transformation-extensions
|
||||
|
||||
.. danger::
|
||||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <openvino_docs_Extensibility_UG_Frontend_Extensions>` article.
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <../../../openvino-extensibility/frontend-extensions>` article.
|
||||
|
||||
Model Optimizer extensions enable you to inject some logic to the model conversion pipeline without changing the Model
|
||||
Optimizer core code. There are three types of the Model Optimizer extensions:
|
||||
|
||||
1. :doc:`Model Optimizer operation <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Operation>`.
|
||||
2. A :doc:`framework operation extractor <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Extractor>`.
|
||||
3. A :doc:`model transformation <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Transformation_Extensions>`, which can be executed during front, middle or back phase of the model conversion.
|
||||
1. :doc:`Model Optimizer operation <[legacy]-model-optimizer-extensions/[legacy]-model-optimizer-operation>`.
|
||||
2. A :doc:`framework operation extractor <[legacy]-model-optimizer-extensions/[legacy]-optimizer-extractor>`.
|
||||
3. A :doc:`model transformation <[legacy]-model-optimizer-extensions/[legacy]-graph-transformation-extensions>`, which can be executed during front, middle or back phase of the model conversion.
|
||||
|
||||
An extension is just a plain text file with a Python code. The file should contain a class (or classes) inherited from
|
||||
one of extension base classes. Extension files should be saved to a directory with the following structure:
|
||||
|
|
@ -56,7 +56,7 @@ Model Optimizer uses the same layout internally to keep built-in extensions. The
|
|||
Additional Resources
|
||||
====================
|
||||
|
||||
* :doc:`Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Extending_Model_Optimizer_With_Caffe_Python_Layers>`
|
||||
* :doc:`Model Optimizer Extensibility <../legacy-model-optimizer-extensibility>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <[legacy]-graph-traversal-and-modification>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <[legacy]-extending-model-optimizer-with-caffe-python-layers>`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Transformation_Extensions}
|
||||
.. {#../[legacy]-model-optimizer-extensions_Model_Optimizer_Transformation_Extensions}
|
||||
|
||||
[LEGACY] Graph Transformation Extensions
|
||||
==========================================
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <openvino_docs_Extensibility_UG_Frontend_Extensions>` article.
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <../../../../openvino-extensibility/frontend-extensions>` article.
|
||||
|
||||
Model Optimizer provides various base classes to implement :ref:`Front Phase Transformations <mo_front_phase_transformations>`,
|
||||
:ref:`Middle Phase Transformations <mo_middle_phase_transformations>`, and :ref:`Back Phase Transformations <mo_back_phase_transformations>`.
|
||||
|
|
@ -19,7 +19,7 @@ All classes have the following common class attributes and methods:
|
|||
|
||||
1. The ``enabled`` attribute specifies whether the transformation is enabled or not. The value can be changed during runtime to enable or disable execution of the transformation during a model conversion. Default value is ``True``.
|
||||
2. The ``id`` attribute specifies a unique transformation string identifier. This transformation identifier can be used to enable (disable) the transformation by setting environment variable ``MO_ENABLED_TRANSFORMS`` (``MO_DISABLED_TRANSFORMS``) with a comma separated list of ``ids``. The environment variables override the value of the ``enabled`` attribute of the transformation. Instead of using ``id`` attribute value you can add fully defined class name to ``MO_ENABLED_TRANSFORMS`` (``MO_DISABLED_TRANSFORMS``) variable, ``extensions.back.NonmalizeToNormalizeL2.NormalizeToNormalizeL2`` for example. It is an optional attribute.
|
||||
3. The ``run_not_recursively`` attribute specifies whether the transformation should be executed in the sub-graphs, for example, body of the :doc:`TensorIterator <openvino_docs_ops_infrastructure_TensorIterator_1>` and the :doc:`Loop <openvino_docs_ops_infrastructure_Loop_5>`. Default value is ``True``.
|
||||
3. The ``run_not_recursively`` attribute specifies whether the transformation should be executed in the sub-graphs, for example, body of the :doc:`TensorIterator <../../../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/tensor-iterator-1>` and the :doc:`Loop <../../../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/loop-5>`. Default value is ``True``.
|
||||
4. The ``force_clean_up`` attribute specifies whether the graph clean up should be executed after the transformation. The graph cleanup removes nodes of the graph not reachable from the model inputs. Default value is ``False``.
|
||||
5. The ``force_shape_inference`` attribute specifies whether the nodes marked with ``need_shape_inference`` attribute equal to ``True`` should be re-inferred after the transformation. Model Optimizer sets this attribute automatically for nodes, input(s) of which were changed during the transformation, or you can set this attribute manually in the transformation for the specific nodes. Default value is ``False``.
|
||||
6. Attribute ``graph_condition`` specifies a list of functions with one parameter -- ``Graph`` object. The transformation is executed if and only if all functions return ``True``. If the attribute is not set, no check is performed.
|
||||
|
|
@ -34,7 +34,7 @@ order. To execute the transformation during a proper model conversion phase, Mod
|
|||
anchor transformations that do nothing. All transformations are ordered with respect to these anchor transformations.
|
||||
The diagram below shows anchor transformations, some of built-in transformations and dependencies between them:
|
||||
|
||||
.. image:: _static/images/MO_transformations_graph.svg
|
||||
.. image:: ../../../../../_static/images/MO_transformations_graph.svg
|
||||
|
||||
User-defined transformations are executed after the corresponding ``Start`` and before the corresponding ``Finish`` anchor
|
||||
transformations by default (if ``run_before()`` and ``run_after()`` methods have not been overridden).
|
||||
|
|
@ -89,7 +89,7 @@ The sub-graph pattern is defined in the ``pattern()`` function. This function sh
|
|||
* The third element (optional) is the dictionary with expected edge attributes. This dictionary usually contains attributes like ``in`` and ``out``, defining input and output ports.
|
||||
|
||||
Consider the example of a front transformation implemented in the ``extensions/front/Mish_fusion.py`` file performing
|
||||
fusing of the sub-graph defining the :doc:`Mish <openvino_docs_ops_activation_Mish_4>` activation function into a single
|
||||
fusing of the sub-graph defining the :doc:`Mish <../../../../openvino-ir-format/operation-sets/operations-specifications/activation/mish-4>` activation function into a single
|
||||
operation:
|
||||
|
||||
.. code-block:: py
|
||||
|
|
@ -210,7 +210,7 @@ Then, Model Optimizer executes the ``find_and_replace_pattern(self, graph)`` met
|
|||
provides a ``Graph`` object as an input.
|
||||
|
||||
Consider the example of a generic front transformation from the ``extensions/front/SqueezeNormalize.py`` file performing
|
||||
normalization of the :doc:`Squeeze <openvino_docs_ops_shape_Squeeze_1>` operation. Older version of the operation had a list of
|
||||
normalization of the :doc:`Squeeze <../../../../openvino-ir-format/operation-sets/operations-specifications/shape/squeeze-1>` operation. Older version of the operation had a list of
|
||||
axes to squeeze as an attribute, but now it is a separate input. For backward compatibility, the Model Optimizer
|
||||
operation supports both semantics. Before IR generation, however, the operation should be normalized according to the
|
||||
specification.
|
||||
|
|
@ -381,7 +381,7 @@ the list is important. The ``i``-th element of the list describes the ``i``-th o
|
|||
obtained using ``match.output_node(i)`` call. The order of elements can be manually changed in the configuration file.
|
||||
Model Optimizer uses this order to connect output edges if the sub-graph is replaced with a single node.
|
||||
|
||||
For more examples of this type of transformation, refer to the :doc:`Converting TensorFlow Object Detection API Models <openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_Object_Detection_API_Models>` guide.
|
||||
For more examples of this type of transformation, refer to the :doc:`Converting TensorFlow Object Detection API Models <../../legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-tensorflow-object-detection>` guide.
|
||||
|
||||
.. _start_end_points_front_phase_transformations:
|
||||
|
||||
|
|
@ -397,7 +397,7 @@ base class and works as follows:
|
|||
1. Starts a graph traversal from every start node following the direction of the graph edges. The search stops in an end node or in the case of a node without consumers. All visited nodes are added to the matched sub-graph.
|
||||
2. Starts another graph traversal from each non-start node of the sub-graph, i.e. every node except nodes from the "start" list. In this step, the edges are traversed in the opposite edge direction. All newly visited nodes are added to the matched sub-graph. This step is needed to add nodes required for calculation values of internal nodes of the matched sub-graph.
|
||||
3. Checks that all "end" nodes were reached from "start" nodes. If not, it exits with an error.
|
||||
4. Checks that there are no :doc:`Parameter <openvino_docs_ops_infrastructure_Parameter_1>` operations among added nodes. If they exist, the sub-graph depends on the inputs of the model. Such configuration is considered incorrect so Model Optimizer exits with an error.
|
||||
4. Checks that there are no :doc:`Parameter <../../../../openvino-ir-format/operation-sets/operations-specifications/infrastructure/parameter-1>` operations among added nodes. If they exist, the sub-graph depends on the inputs of the model. Such configuration is considered incorrect so Model Optimizer exits with an error.
|
||||
|
||||
This algorithm finds all nodes "between" start and end nodes and nodes needed for calculation of non-input nodes of the
|
||||
matched sub-graph.
|
||||
|
|
@ -447,10 +447,10 @@ respectively.
|
|||
The ``include_inputs_to_sub_graph`` and ``include_outputs_to_sub_graph`` parameters are redundant and should be always equal to ``true``.
|
||||
|
||||
.. note::
|
||||
This sub-graph match algorithm has a limitation that each start node must have only one input. Therefore, it is not possible to specify, for example, the :doc:`Convolution <openvino_docs_ops_convolution_Convolution_1>` node as input because it has two inputs: data tensor and tensor with weights.
|
||||
This sub-graph match algorithm has a limitation that each start node must have only one input. Therefore, it is not possible to specify, for example, the :doc:`Convolution <../../../../openvino-ir-format/operation-sets/operations-specifications/convolution/convolution-1>` node as input because it has two inputs: data tensor and tensor with weights.
|
||||
|
||||
For other examples of transformations with points, refer to the
|
||||
:doc:`Converting TensorFlow Object Detection API Models <openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_Object_Detection_API_Models>` guide.
|
||||
:doc:`Converting TensorFlow Object Detection API Models <../../legacy-conversion-api/[legacy]-supported-model-formats/[legacy]-conversion-tutorials/convert-tensorflow-object-detection>` guide.
|
||||
|
||||
.. _generic_transformations_config_front_phase_transformations:
|
||||
|
||||
|
|
@ -600,8 +600,8 @@ For the example of this transformation, refer to the ``extensions/back/GatherNor
|
|||
Additional Resources
|
||||
====================
|
||||
|
||||
* :doc:`Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections>`
|
||||
* :doc:`Model Optimizer Extensions <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Extending_Model_Optimizer_With_Caffe_Python_Layers>`
|
||||
* :doc:`Model Optimizer Extensibility <../../legacy-model-optimizer-extensibility>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <../../legacy-model-optimizer-extensibility/[legacy]-graph-traversal-and-modification>`
|
||||
* :doc:`Model Optimizer Extensions <../[legacy]-model-optimizer-extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <../[legacy]-extending-model-optimizer-with-caffe-python-layers>`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Operation}
|
||||
.. {#../[legacy]-model-optimizer-extensions_Model_Optimizer_Operation}
|
||||
|
||||
[LEGACY] Model Optimizer Operation
|
||||
===================================
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <openvino_docs_Extensibility_UG_Frontend_Extensions>` article.
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <../../../../openvino-extensibility/frontend-extensions>` article.
|
||||
|
||||
Model Optimizer defines a ``mo.ops.Op`` class (``Op`` will be used later in the document to be short), which is a base class
|
||||
for an operation used in the Model Optimizer. The instance of the ``Op`` class serves several purposes:
|
||||
|
|
@ -32,15 +32,15 @@ There are a number of common attributes used in the operations. Below is the lis
|
|||
|
||||
* ``id`` — **(Mandatory)** — unique identifier of a node in a graph. Generated automatically, equal to the number of nodes in the graph plus 1 if not specified.
|
||||
* ``name`` — **(Mandatory)** — name of the operation. Generated automatically, equal to the ``id`` if not specified.
|
||||
* ``type`` — **(Mandatory)** — type of the operation according to the :doc:`opset specification <openvino_docs_ops_opset>`. For the internal Model Optimizer operations, this attribute should be set to ``None``. The model conversion fails if an operation with ``type`` equal to ``None`` comes to the IR emitting phase.
|
||||
* ``version`` — **(Mandatory)** — the operation set (opset) name the operation belongs to. If not specified, Model Optimizer sets it equal to ``experimental``. For more information about operation sets, refer to :doc:`OpenVINO Model Representation <openvino_docs_OV_UG_Model_Representation>` section.
|
||||
* ``type`` — **(Mandatory)** — type of the operation according to the :doc:`opset specification <../../../../openvino-ir-format/operation-sets/available-opsets>`. For the internal Model Optimizer operations, this attribute should be set to ``None``. The model conversion fails if an operation with ``type`` equal to ``None`` comes to the IR emitting phase.
|
||||
* ``version`` — **(Mandatory)** — the operation set (opset) name the operation belongs to. If not specified, Model Optimizer sets it equal to ``experimental``. For more information about operation sets, refer to :doc:`OpenVINO Model Representation <../../../../../openvino-workflow/running-inference/integrate-openvino-with-your-application/model-representation>` section.
|
||||
* ``op`` — Model Optimizer type of the operation. In many cases, the value of ``type`` is equal to the value of ``op``. However, when Model Optimizer cannot instantiate the opset operation during model loading, it creates an instance of an internal operation. Thus, the attribute ``op`` is used as a type of this internal operation. Later in the pipeline, the node created from an internal operation will be replaced during front, middle or back phase with node(s) created from the opset.
|
||||
* ``infer`` — the attribute defines a function calculating output tensor(s) shape and optional value(s). The attribute may be set to ``None`` for the internal Model Optimizer operations used during the front phase only. For more information about the shape inference function, refer to the :ref:`Partial Inference <mo_partial_inference>`.
|
||||
* ``type_infer`` — the attribute defines a function calculating output tensor(s) data type. If the attribute is not defined, the default function is used. The function checks if the ``data_type`` node attribute is set and then propagates this type to the output tensor from the **port 0**. Otherwise, it propagates the data type of the tensor coming into the input **port 0** to the output tensor from the **port 0**.
|
||||
* ``in_ports_count`` — default number of input ports to be created for the operation. Additional ports can be created or redundant ports can be removed using dedicated ``Node`` class API methods.
|
||||
* ``out_ports_count`` — default number of output ports to be created for the operation. Additional ports can be created or redundant ports can be removed using dedicated ``Node`` class API methods.
|
||||
|
||||
Below is an example of the Model Optimizer class for the :doc:`SoftMax <openvino_docs_ops_activation_SoftMax_1>` operation from
|
||||
Below is an example of the Model Optimizer class for the :doc:`SoftMax <../../../../openvino-ir-format/operation-sets/operations-specifications/activation/softmax-1>` operation from
|
||||
the ``mo/ops/softmax.py`` file with the comments in code.
|
||||
|
||||
.. code-block:: py
|
||||
|
|
@ -105,8 +105,8 @@ The ``backend_attrs()`` function returns a list of records. A record can be of o
|
|||
Additional Resources
|
||||
====================
|
||||
|
||||
* :doc:`Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections>`
|
||||
* :doc:`Model Optimizer Extensions <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Extending_Model_Optimizer_With_Caffe_Python_Layers>`
|
||||
* :doc:`Model Optimizer Extensibility <../../legacy-model-optimizer-extensibility>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <../../legacy-model-optimizer-extensibility/[legacy]-graph-traversal-and-modification>`
|
||||
* :doc:`Model Optimizer Extensions <../[legacy]-model-optimizer-extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <../[legacy]-extending-model-optimizer-with-caffe-python-layers>`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions_Model_Optimizer_Extractor}
|
||||
.. {#../[legacy]-model-optimizer-extensions_Model_Optimizer_Extractor}
|
||||
|
||||
[LEGACY] Operation Extractor
|
||||
=============================
|
||||
|
|
@ -13,14 +13,14 @@
|
|||
|
||||
The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.
|
||||
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <openvino_docs_Extensibility_UG_Frontend_Extensions>` article.
|
||||
This guide describes a deprecated TensorFlow conversion method. The guide on the new and recommended method, using a new frontend, can be found in the :doc:`Frontend Extensions <../../../../openvino-extensibility/frontend-extensions>` article.
|
||||
|
||||
Model Optimizer runs specific extractor for each operation in the model during the model loading.
|
||||
|
||||
There are several types of Model Optimizer extractor extensions:
|
||||
|
||||
1. The generic one, which is described in this article.
|
||||
2. The special extractor for Caffe models with Python layers. This kind of extractor is described in the :doc:`Extending Model Optimizer with Caffe Python Layers <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Extending_Model_Optimizer_With_Caffe_Python_Layers>` guide.
|
||||
2. The special extractor for Caffe models with Python layers. This kind of extractor is described in the :doc:`Extending Model Optimizer with Caffe Python Layers <../[legacy]-extending-model-optimizer-with-caffe-python-layers>` guide.
|
||||
|
||||
Generic extension provides a generic mechanism for the operation extractor applicable for all frameworks. Model Optimizer provides the ``mo.front.extractor.FrontExtractorOp`` class as a base class to implement the extractor. It has the ``extract`` class method, which gets the only parameter ``Node``, which corresponds to the graph node to extract data from. The operation description in the original framework format is stored in the attribute ``pb`` of the node. The extractor goal is to parse this attribute and save necessary attributes to the corresponding node of the graph. Consider the extractor for the ``Const`` TensorFlow operation (refer to the ``extensions/front/tf/const_ext.py`` file):
|
||||
|
||||
|
|
@ -108,8 +108,8 @@ A common practice is to use ``update_node_stat()`` method of the dedicated ``Op`
|
|||
Additional Resources
|
||||
====================
|
||||
|
||||
* :doc:`Model Optimizer Extensibility <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer_Model_Optimizer_Ports_Connections>`
|
||||
* :doc:`Model Optimizer Extensions <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Model_Optimizer_Extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Extending_Model_Optimizer_With_Caffe_Python_Layers>`
|
||||
* :doc:`Model Optimizer Extensibility <../../legacy-model-optimizer-extensibility>`
|
||||
* :doc:`Graph Traversal and Modification Using Ports and Connections <../../legacy-model-optimizer-extensibility/[legacy]-graph-traversal-and-modification>`
|
||||
* :doc:`Model Optimizer Extensions <../[legacy]-model-optimizer-extensions>`
|
||||
* :doc:`Extending Model Optimizer with Caffe Python Layers <../[legacy]-extending-model-optimizer-with-caffe-python-layers>`
|
||||
|
||||
|
|
|
|||
|
|
@ -5,16 +5,16 @@ OpenVINO™ Ecosystem Overview
|
|||
|
||||
|
||||
.. meta::
|
||||
:description: OpenVINO™ ecosystem offers various resources for developing deep learning solutions.
|
||||
:description: OpenVINO™ ecosystem offers various ../about-openvino/additional-resources for developing deep learning solutions.
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
ote_documentation
|
||||
datumaro_documentation
|
||||
ovsa_get_started
|
||||
openvino-ecosystem/openvino-training-extensions
|
||||
openvino-ecosystem/datumaro
|
||||
openvino-ecosystem/openvino-security-add-on
|
||||
|
||||
|
||||
OpenVINO™ is not just one tool. It is an expansive ecosystem of utilities, providing a comprehensive workflow for deep learning solution development. Learn more about each of them to reach the full potential of OpenVINO™ Toolkit.
|
||||
|
|
@ -26,7 +26,7 @@ A suite of advanced algorithms for Neural Network inference optimization with mi
|
|||
|
||||
More resources:
|
||||
|
||||
* :doc:`Documentation <tmo_introduction>`
|
||||
* :doc:`Documentation <../openvino-workflow/model-optimization-guide/compressing-models-during-training>`
|
||||
* `GitHub <https://github.com/openvinotoolkit/nncf>`__
|
||||
* `PyPI <https://pypi.org/project/nncf/>`__
|
||||
* `Conda Forge <https://anaconda.org/conda-forge/nncf/>`__
|
||||
|
|
@ -38,9 +38,9 @@ A convenient environment to train Deep Learning models and convert them using th
|
|||
|
||||
More resources:
|
||||
|
||||
* :doc:`Overview <ote_documentation>`
|
||||
* :doc:`Overview <openvino-ecosystem/openvino-training-extensions>`
|
||||
* `GitHub <https://github.com/openvinotoolkit/training_extensions>`__
|
||||
* `Documentation <https://openvinotoolkit.github.io/training_extensions/stable/guide/get_started/introduction.html>`__
|
||||
* `Documentation <https://openvinotoolkit.github.io/training_extensions/stable/guide/../get-started/introduction.html>`__
|
||||
|
||||
**OpenVINO™ Security Add-on**
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ A solution for Model Developers and Independent Software Vendors to use secure p
|
|||
|
||||
More resources:
|
||||
|
||||
* :doc:`Documentation <ovsa_get_started>`
|
||||
* :doc:`Documentation <openvino-ecosystem/openvino-security-add-on>`
|
||||
* `GitHub <https://github.com/openvinotoolkit/security_addon>`__
|
||||
|
||||
**Dataset Management Framework (Datumaro)**
|
||||
|
|
@ -57,7 +57,7 @@ A framework and CLI tool to build, transform, and analyze datasets.
|
|||
|
||||
More resources:
|
||||
|
||||
* :doc:`Overview <datumaro_documentation>`
|
||||
* :doc:`Overview <openvino-ecosystem/datumaro>`
|
||||
* `PyPI <https://pypi.org/project/datumaro/>`__
|
||||
* `GitHub <https://github.com/openvinotoolkit/datumaro>`__
|
||||
* `Documentation <https://openvinotoolkit.github.io/datumaro/stable/docs/get-started/introduction.html>`__
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#datumaro_documentation}
|
||||
.. {#datumaro_../../documentation}
|
||||
|
||||
Datumaro
|
||||
========
|
||||
|
|
@ -21,7 +21,7 @@ Plus, enjoy `Jupyter notebooks <https://github.com/openvinotoolkit/datumaro/tree
|
|||
Detailed Workflow
|
||||
#################
|
||||
|
||||
.. image:: ./_static/images/datumaro.png
|
||||
.. image:: ./../../_static/images/datumaro.png
|
||||
|
||||
1. To start working with Datumaro, download public datasets or prepare your own annotated dataset.
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ Detailed Workflow
|
|||
annotations. Please see `SplitTask` for the task-specific split.
|
||||
|
||||
6. Export the cleaned and unified dataset for follow-up workflows such as model training.
|
||||
Go to :doc:`OpenVINO™ Training Extensions <ote_documentation>`.
|
||||
Go to :doc:`OpenVINO™ Training Extensions <openvino-training-extensions>`.
|
||||
|
||||
If the results are unsatisfactory, add datasets and perform the same steps, starting with dataset annotation.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#ovsa_get_started}
|
||||
.. {#ovsa_../../get-started}
|
||||
|
||||
OpenVINO™ Security Add-on
|
||||
===========================
|
||||
|
|
@ -19,7 +19,7 @@ In this release, one person performs the role of both the Model Developer and th
|
|||
Overview
|
||||
########
|
||||
|
||||
The OpenVINO™ Security Add-on works with the :doc:`OpenVINO™ Model Server <ovms_what_is_openvino_model_server>` on Intel® architecture. Together, the OpenVINO™ Security Add-on and the OpenVINO™ Model Server provide a way for Model Developers and Independent Software Vendors to use secure packaging and secure model execution to enable access control to the OpenVINO™ models, and for model Users to run inference within assigned limits.
|
||||
The OpenVINO™ Security Add-on works with the :doc:`OpenVINO™ Model Server <../../ovms_what_is_openvino_model_server>` on Intel® architecture. Together, the OpenVINO™ Security Add-on and the OpenVINO™ Model Server provide a way for Model Developers and Independent Software Vendors to use secure packaging and secure model execution to enable access control to the OpenVINO™ models, and for model Users to run inference within assigned limits.
|
||||
|
||||
The OpenVINO™ Security Add-on consists of three components that run in Kernel-based Virtual Machines (KVMs). These components provide a way to run security-sensitive operations in an isolated environment. A brief description of the three components are as follows. Click each triangled line for more information about each.
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ The OpenVINO™ Security Add-on consists of three components that run in Kernel-
|
|||
|
||||
**Where the OpenVINO™ Security Add-on Fits into Model Development and Deployment**
|
||||
|
||||
.. image:: _static/images/ovsa_diagram.svg
|
||||
.. image:: ../../_static/images/ovsa_diagram.svg
|
||||
|
||||
The binding between SWTPM (vTPM used in guest VM) and HW TPM (TPM on the host) is explained in `this document. <https://github.com/openvinotoolkit/security_addon/blob/master/docs/fingerprint-changes.md>`__
|
||||
|
||||
|
|
@ -300,7 +300,7 @@ This example in this step uses the following names. Your configuration might use
|
|||
ifconfig $nic 0.0.0.0 down
|
||||
|
||||
|
||||
See the QEMU documentation for more information about the QEMU network configuration.
|
||||
See the QEMU ../../documentation for more information about the QEMU network configuration.
|
||||
|
||||
Networking is set up on the Host Machine. Continue to the Step 3 to prepare a Guest VM for the combined role of Model Developer and Independent Software Vendor.
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ For each separate role you play, you must prepare a virtual machine, called a Gu
|
|||
|
||||
Begin these steps on the Host Machine.
|
||||
|
||||
As an option, you can use ``virsh`` and the virtual machine manager to create and bring up a Guest VM. See the ``libvirtd`` documentation for instructions if you'd like to do this.
|
||||
As an option, you can use ``virsh`` and the virtual machine manager to create and bring up a Guest VM. See the ``libvirtd`` ../../documentation for instructions if you'd like to do this.
|
||||
|
||||
1. Download the **Server install ISO image for 64-bit PC (AMD64) computers** of `Ubuntu 18.04 <https://releases.ubuntu.com/18.04/>`__
|
||||
|
||||
|
|
@ -736,7 +736,7 @@ How to Use the OpenVINO™ Security Add-on
|
|||
|
||||
This section requires interactions between the Model Developer/Independent Software vendor and the User. All roles must complete all applicable :ref:`set up steps <setup-host>` and :ref:`installation steps <ovsa-install>` before beginning this section.
|
||||
|
||||
This document uses the :ref:`face-detection-retail-0004 <omz_models_model_face_detection_retail_0044>` model as an example.
|
||||
This document uses the :ref:`face-detection-retail-0004 <../../omz_models_model_face_detection_retail_0044>` model as an example.
|
||||
|
||||
The following figure describes the interactions between the Model Developer, Independent Software Vendor, and User.
|
||||
|
||||
|
|
@ -744,7 +744,7 @@ The following figure describes the interactions between the Model Developer, Ind
|
|||
|
||||
The Model Developer/Independent Software Vendor and User roles are related to virtual machine use and one person might fill the tasks required by multiple roles. In this document the tasks of Model Developer and Independent Software Vendor are combined and use the Guest VM named ``ovsa_isv``. It is possible to have all roles set up on the same Host Machine.
|
||||
|
||||
.. image:: _static/images/ovsa_example.svg
|
||||
.. image:: ../../_static/images/ovsa_example.svg
|
||||
|
||||
Model Developer Instructions
|
||||
++++++++++++++++++++++++++++
|
||||
|
|
@ -799,7 +799,7 @@ Download a model from the Model Zoo:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
curl --create-dirs https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/1/face-detection-retail-0004/FP32/face-detection-retail-0004.xml https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/1/face-detection-retail-0004/FP32/face-detection-retail-0004.bin -o model/face-detection-retail-0004.xml -o model/face-detection-retail-0004.bin
|
||||
curl --create-dirs https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_../legacy-features/model-zoo/models_bin/1/face-detection-retail-0004/FP32/face-detection-retail-0004.xml https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_../legacy-features/model-zoo/models_bin/1/face-detection-retail-0004/FP32/face-detection-retail-0004.bin -o model/face-detection-retail-0004.xml -o model/face-detection-retail-0004.bin
|
||||
|
||||
The model is downloaded to the ``OVSA_DEV_ARTEFACTS/model`` directory
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#ote_documentation}
|
||||
.. {#ote_../../documentation}
|
||||
|
||||
OpenVINO™ Training Extensions
|
||||
===============================
|
||||
|
|
@ -13,12 +13,12 @@ OpenVINO™ Training Extensions
|
|||
OpenVINO™ Training Extensions provide a suite of advanced algorithms to train
|
||||
Deep Learning models and convert them using the `OpenVINO™
|
||||
toolkit <https://software.intel.com/en-us/openvino-toolkit>`__ for optimized
|
||||
inference. It allows you to export and convert the models to the needed format. OpenVINO Training Extensions independently create and train the model. It is open-sourced and available on `GitHub <https://github.com/openvinotoolkit/training_extensions>`__. Read the OpenVINO Training Extensions `documentation <https://openvinotoolkit.github.io/training_extensions/stable/guide/get_started/introduction.html>`__ to learn more.
|
||||
inference. It allows you to export and convert the models to the needed format. OpenVINO Training Extensions independently create and train the model. It is open-sourced and available on `GitHub <https://github.com/openvinotoolkit/training_extensions>`__. Read the OpenVINO Training Extensions `../../documentation <https://openvinotoolkit.github.io/training_extensions/stable/guide/../../get-started/introduction.html>`__ to learn more.
|
||||
|
||||
Detailed Workflow
|
||||
#################
|
||||
|
||||
.. image:: ./_static/images/training_extensions_framework.png
|
||||
.. image:: ./../../_static/images/training_extensions_framework.png
|
||||
|
||||
1. To start working with OpenVINO Training Extensions, prepare and annotate your dataset. For example, on CVAT.
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ Detailed Workflow
|
|||
.. note::
|
||||
Prepare a separate dataset or split the dataset you have for more accurate quality evaluation.
|
||||
|
||||
3. Having successful evaluation results received, you have an opportunity to deploy your model or continue optimizing it, using NNCF. For more information about these frameworks, go to :doc:`Optimization Guide <openvino_docs_model_optimization_guide>`.
|
||||
3. Having successful evaluation results received, you have an opportunity to deploy your model or continue optimizing it, using NNCF. For more information about these frameworks, go to :doc:`Optimization Guide <../../openvino-workflow/model-optimization>`.
|
||||
|
||||
If the results are unsatisfactory, add datasets and perform the same steps, starting with dataset annotation.
|
||||
|
||||
|
|
|
|||
|
|
@ -13,21 +13,21 @@ OpenVINO Extensibility Mechanism
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_Extensibility_UG_add_openvino_ops
|
||||
openvino_docs_Extensibility_UG_Frontend_Extensions
|
||||
openvino_docs_Extensibility_UG_GPU
|
||||
openvino-extensibility/custom-openvino-operations
|
||||
openvino-extensibility/frontend-extensions
|
||||
openvino-extensibility/custom-gpu-operations
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_transformations
|
||||
OpenVINO Plugin Developer Guide <openvino_docs_ie_plugin_dg_overview>
|
||||
openvino-extensibility/transformations-api
|
||||
OpenVINO Plugin Developer Guide <openvino-extensibility/openvino-plugin-library>
|
||||
|
||||
|
||||
The Intel® Distribution of OpenVINO™ toolkit supports neural-network models trained with various frameworks, including
|
||||
TensorFlow, PyTorch, ONNX, TensorFlow Lite, and PaddlePaddle. The list of supported operations is different for each of the supported frameworks.
|
||||
To see the operations supported by your framework, refer to :doc:`Supported Framework Operations <openvino_resources_supported_operations_frontend>`.
|
||||
To see the operations supported by your framework, refer to :doc:`Supported Framework Operations <../about-openvino/compatibility-and-support/supported-operations-framework-frontend>`.
|
||||
|
||||
Custom operations, which are not included in the list, are not recognized by OpenVINO out-of-the-box. The need for custom operation may appear in two cases:
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ Importing models with such operations requires additional steps. This guide illu
|
|||
|
||||
Defining a new custom operation basically consists of two parts:
|
||||
|
||||
1. Definition of operation semantics in OpenVINO, the code that describes how this operation should be inferred consuming input tensor(s) and producing output tensor(s). The implementation of execution kernels for :doc:`GPU <openvino_docs_Extensibility_UG_GPU>` is described in separate guides.
|
||||
1. Definition of operation semantics in OpenVINO, the code that describes how this operation should be inferred consuming input tensor(s) and producing output tensor(s). The implementation of execution kernels for :doc:`GPU <openvino-extensibility/custom-gpu-operations>` is described in separate guides.
|
||||
|
||||
2. Mapping rule that facilitates conversion of framework operation representation to OpenVINO defined operation semantics.
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ Definition of Operation Semantics
|
|||
|
||||
If the custom operation can be mathematically represented as a combination of exiting OpenVINO operations and such decomposition gives desired performance, then low-level operation implementation is not required. Refer to the latest OpenVINO operation set, when deciding feasibility of such decomposition. You can use any valid combination of exiting operations. The next section of this document describes the way to map a custom operation.
|
||||
|
||||
If such decomposition is not possible or appears too bulky with a large number of constituent operations that do not perform well, then a new class for the custom operation should be implemented, as described in the :doc:`Custom Operation Guide <openvino_docs_Extensibility_UG_add_openvino_ops>`.
|
||||
If such decomposition is not possible or appears too bulky with a large number of constituent operations that do not perform well, then a new class for the custom operation should be implemented, as described in the :doc:`Custom Operation Guide <openvino-extensibility/custom-openvino-operations>`.
|
||||
|
||||
You might prefer implementing a custom operation class if you already have a generic C++ implementation of operation kernel. Otherwise, try to decompose the operation first, as described above. Then, after verifying correctness of inference and resulting performance, you may move on to optional implementation of Bare Metal C++.
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ Mapping from Framework Operation
|
|||
|
||||
Mapping of custom operation is implemented differently, depending on model format used for import.
|
||||
If a model is represented in the ONNX (including models exported from PyTorch in ONNX), TensorFlow Lite, PaddlePaddle or
|
||||
TensorFlow formats, then one of the classes from :doc:`Frontend Extension API <openvino_docs_Extensibility_UG_Frontend_Extensions>`
|
||||
TensorFlow formats, then one of the classes from :doc:`Frontend Extension API <openvino-extensibility/frontend-extensions>`
|
||||
should be used. It consists of several classes available in C++ which can be used with the ``--extensions`` option in Model Optimizer
|
||||
or when a model is imported directly to OpenVINO runtime using the ``read_model`` method.
|
||||
Python API is also available for runtime model import.
|
||||
|
|
@ -80,7 +80,7 @@ Registering Extensions
|
|||
A custom operation class and a new mapping frontend extension class object should be registered to be usable in OpenVINO runtime.
|
||||
|
||||
.. note::
|
||||
This documentation is derived from the `Template extension <https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new>`__, which demonstrates the details of extension development. It is based on minimalistic ``Identity`` operation that is a placeholder for your real custom operation. Review the complete, fully compilable code to see how it works.
|
||||
This ../documentation is derived from the `Template extension <https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new>`__, which demonstrates the details of extension development. It is based on minimalistic ``Identity`` operation that is a placeholder for your real custom operation. Review the complete, fully compilable code to see how it works.
|
||||
|
||||
Use the ``ov::Core::add_extension`` method to load the extensions to the ``ov::Core`` object. This method allows loading library with extensions or extensions from the code.
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ Extensions can be loaded from a code with the ``ov::Core::add_extension`` metho
|
|||
:fragment: [add_extension]
|
||||
|
||||
|
||||
The ``Identity`` is a custom operation class defined in :doc:`Custom Operation Guide <openvino_docs_Extensibility_UG_add_openvino_ops>`. This is sufficient to enable reading OpenVINO IR which uses the ``Identity`` extension operation emitted by Model Optimizer. In order to load original model directly to the runtime, add a mapping extension:
|
||||
The ``Identity`` is a custom operation class defined in :doc:`Custom Operation Guide <openvino-extensibility/custom-openvino-operations>`. This is sufficient to enable reading OpenVINO IR which uses the ``Identity`` extension operation emitted by Model Optimizer. In order to load original model directly to the runtime, add a mapping extension:
|
||||
|
||||
.. tab-set::
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ This CMake script finds OpenVINO, using the ``find_package`` CMake command.
|
|||
See Also
|
||||
########
|
||||
|
||||
* :doc:`OpenVINO Transformations <openvino_docs_transformations>`
|
||||
* :doc:`Using OpenVINO Runtime Samples <openvino_docs_OV_UG_Samples_Overview>`
|
||||
* :doc:`Hello Shape Infer SSD sample <openvino_sample_hello_reshape_ssd>`
|
||||
* :doc:`OpenVINO Transformations <openvino-extensibility/transformations-api>`
|
||||
* :doc:`Using OpenVINO Runtime Samples <../learn-openvino/openvino-samples>`
|
||||
* :doc:`Hello Shape Infer SSD sample <../learn-openvino/openvino-samples/hello-reshape-ssd>`
|
||||
|
||||
|
|
|
|||
|
|
@ -12,17 +12,17 @@ Frontend Extensions
|
|||
|
||||
The goal of this chapter is to explain how to use Frontend extension classes to facilitate
|
||||
mapping of custom operations from framework model representation to OpenVINO representation.
|
||||
Refer to :doc:`Introduction to OpenVINO Extension <openvino_docs_Extensibility_UG_Intro>` to
|
||||
Refer to :doc:`Introduction to OpenVINO Extension <../openvino-extensibility>` to
|
||||
understand the entire flow.
|
||||
|
||||
This API is applicable to new frontends only, which exist for ONNX, TensorFlow Lite, PaddlePaddle, and TensorFlow.
|
||||
If a different model format is used, follow legacy
|
||||
:doc:`Model Optimizer Extensions <openvino_docs_MO_DG_prepare_model_customize_model_optimizer_Customize_Model_Optimizer>`
|
||||
:doc:`Model Optimizer Extensions <../legacy-features/transition-legacy-conversion-api/legacy-model-optimizer-extensibility>`
|
||||
guide.
|
||||
|
||||
.. note::
|
||||
|
||||
This documentation is written based on the `Template extension <https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new>`__,
|
||||
This ../../documentation is written based on the `Template extension <https://github.com/openvinotoolkit/openvino/tree/master/src/core/template_extension/new>`__,
|
||||
which demonstrates extension development details based on minimalistic ``Identity``
|
||||
operation that is a placeholder for your real custom operation. You can review the complete code,
|
||||
which is fully compilable, to see how it works.
|
||||
|
|
@ -77,7 +77,7 @@ OpenVINO runtime just before the loading a model that contains custom operations
|
|||
Or extensions can be constructed in a separately compiled shared library.
|
||||
Separately compiled library can be used in Model Optimizer or ``benchmark_app``.
|
||||
Read about how to build and load such a library in the chapter of “Create library with extensions” in
|
||||
:doc:`Introduction to OpenVINO Extension <openvino_docs_Extensibility_UG_Intro>`.
|
||||
:doc:`Introduction to OpenVINO Extension <../openvino-extensibility>`.
|
||||
|
||||
If operation have multiple inputs and/or outputs they will be mapped in order.
|
||||
The type of elements in input/output tensors should match expected types in the surrounding operations.
|
||||
|
|
@ -409,7 +409,7 @@ The following example shows such conversion for the ``top_k_v2`` operation.
|
|||
For TensorFlow framework, if an operation has more than one output, it is recommended to assign names to
|
||||
those outputs using the ``NamedOutputVector`` structure which allows both indexed and named output access.
|
||||
For a description of TensorFlow operations, including the names of their outputs, refer to the
|
||||
`tf.raw_ops <https://www.tensorflow.org/api_docs/python/tf/raw_ops/>`__ documentation page.
|
||||
`tf.raw_ops <https://www.tensorflow.org/api_docs/python/tf/raw_ops/>`__ ../../documentation page.
|
||||
The next example shows such conversion for the ``TopKV2`` operation.
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ov_extensions.cpp
|
||||
|
|
|
|||
|
|
@ -15,17 +15,17 @@ Overview of OpenVINO Plugin Library
|
|||
:caption: Converting and Preparing Models
|
||||
:hidden:
|
||||
|
||||
Implement Plugin Functionality <openvino_docs_ov_plugin_dg_plugin>
|
||||
Implement Compiled Model Functionality <openvino_docs_ov_plugin_dg_compiled_model>
|
||||
Implement Synchronous Inference Request <openvino_docs_ov_plugin_dg_infer_request>
|
||||
Implement Asynchronous Inference Request <openvino_docs_ov_plugin_dg_async_infer_request>
|
||||
Provide Plugin Specific Properties <openvino_docs_ov_plugin_dg_properties>
|
||||
Implement Remote Context <openvino_docs_ov_plugin_dg_remote_context>
|
||||
Implement Remote Tensor <openvino_docs_ov_plugin_dg_remote_tensor>
|
||||
openvino_docs_ov_plugin_dg_plugin_build
|
||||
openvino_docs_ov_plugin_dg_plugin_testing
|
||||
openvino_docs_ie_plugin_detailed_guides
|
||||
openvino_docs_ie_plugin_api_references
|
||||
Implement Plugin Functionality <openvino-plugin-library/plugin>
|
||||
Implement Compiled Model Functionality <openvino-plugin-library/compiled-model>
|
||||
Implement Synchronous Inference Request <openvino-plugin-library/synch-inference-request>
|
||||
Implement Asynchronous Inference Request <openvino-plugin-library/asynch-inference-request>
|
||||
Provide Plugin Specific Properties <openvino-plugin-library/plugi-properties>
|
||||
Implement Remote Context <openvino-plugin-library/remote-context>
|
||||
Implement Remote Tensor <openvino-plugin-library/remote-tensor>
|
||||
openvino-plugin-library/build-plugin-using-cmake
|
||||
openvino-plugin-library/plugin-testing
|
||||
openvino-plugin-library/advanced-guides
|
||||
openvino-plugin-library/plugin-api-references
|
||||
|
||||
|
||||
The plugin architecture of OpenVINO allows to develop and plug independent inference
|
||||
|
|
@ -37,60 +37,60 @@ OpenVINO Plugin Library
|
|||
|
||||
OpenVINO plugin dynamic library consists of several main components:
|
||||
|
||||
1. :doc:`Plugin class <openvino_docs_ov_plugin_dg_plugin>`:
|
||||
1. :doc:`Plugin class <openvino-plugin-library/plugin>`:
|
||||
|
||||
* Provides information about devices of a specific type.
|
||||
* Can create an :doc:`compiled model <openvino_docs_ov_plugin_dg_compiled_model>` instance which represents a Neural Network backend specific graph structure for a particular device in opposite to the ov::Model which is backend-independent.
|
||||
* Can import an already compiled graph structure from an input stream to a :doc:`compiled model <openvino_docs_ov_plugin_dg_compiled_model>` object.
|
||||
* Can create an :doc:`compiled model <openvino-plugin-library/compiled-model>` instance which represents a Neural Network backend specific graph structure for a particular device in opposite to the ov::Model which is backend-independent.
|
||||
* Can import an already compiled graph structure from an input stream to a :doc:`compiled model <openvino-plugin-library/compiled-model>` object.
|
||||
|
||||
|
||||
2. :doc:`Compiled Model class <openvino_docs_ov_plugin_dg_compiled_model>`:
|
||||
2. :doc:`Compiled Model class <openvino-plugin-library/compiled-model>`:
|
||||
|
||||
* Is an execution configuration compiled for a particular device and takes into account its capabilities.
|
||||
* Holds a reference to a particular device and a task executor for this device.
|
||||
* Can create several instances of :doc:`Inference Request <openvino_docs_ov_plugin_dg_infer_request>`.
|
||||
* Can create several instances of :doc:`Inference Request <openvino-plugin-library/synch-inference-request>`.
|
||||
* Can export an internal backend specific graph structure to an output stream.
|
||||
|
||||
|
||||
3. :doc:`Inference Request class <openvino_docs_ov_plugin_dg_infer_request>`:
|
||||
3. :doc:`Inference Request class <openvino-plugin-library/synch-inference-request>`:
|
||||
|
||||
* Runs an inference pipeline serially.
|
||||
* Can extract performance counters for an inference pipeline execution profiling.
|
||||
|
||||
|
||||
4. :doc:`Asynchronous Inference Request class <openvino_docs_ov_plugin_dg_async_infer_request>`:
|
||||
4. :doc:`Asynchronous Inference Request class <openvino-plugin-library/asynch-inference-request>`:
|
||||
|
||||
* Wraps the :doc:`Inference Request <openvino_docs_ov_plugin_dg_infer_request>` class and runs pipeline stages in parallel on several task executors based on a device-specific pipeline structure.
|
||||
* Wraps the :doc:`Inference Request <openvino-plugin-library/synch-inference-request>` class and runs pipeline stages in parallel on several task executors based on a device-specific pipeline structure.
|
||||
|
||||
|
||||
5. :doc:`Plugin specific properties <openvino_docs_ov_plugin_dg_properties>`:
|
||||
5. :doc:`Plugin specific properties <openvino-plugin-library/plugi-properties>`:
|
||||
|
||||
* Provides the plugin specific properties.
|
||||
|
||||
|
||||
6. :doc:`Remote Context <openvino_docs_ov_plugin_dg_remote_context>`:
|
||||
6. :doc:`Remote Context <openvino-plugin-library/remote-context>`:
|
||||
|
||||
* Provides the device specific remote context. Context allows to create remote tensors.
|
||||
|
||||
|
||||
7. :doc:`Remote Tensor <openvino_docs_ov_plugin_dg_remote_tensor>`
|
||||
7. :doc:`Remote Tensor <openvino-plugin-library/remote-tensor>`
|
||||
|
||||
* Provides the device specific remote tensor API and implementation.
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
This documentation is written based on the ``Template`` plugin, which demonstrates plugin development details. Find the complete code of the ``Template``, which is fully compilable and up-to-date, at ``<openvino source dir>/src/plugins/template``.
|
||||
This ../../documentation is written based on the ``Template`` plugin, which demonstrates plugin development details. Find the complete code of the ``Template``, which is fully compilable and up-to-date, at ``<openvino source dir>/src/plugins/template``.
|
||||
|
||||
|
||||
Detailed Guides
|
||||
###############
|
||||
|
||||
* :doc:`Build <openvino_docs_ov_plugin_dg_plugin_build>` a plugin library using CMake
|
||||
* Plugin and its components :doc:`testing <openvino_docs_ov_plugin_dg_plugin_testing>`
|
||||
* :doc:`Quantized networks <openvino_docs_ov_plugin_dg_quantized_models>`
|
||||
* :doc:`Low precision transformations <openvino_docs_OV_UG_lpt>` guide
|
||||
* :doc:`Writing OpenVINO™ transformations <openvino_docs_transformations>` guide
|
||||
* :doc:`Build <openvino-plugin-library/build-plugin-using-cmake>` a plugin library using CMake
|
||||
* Plugin and its components :doc:`testing <openvino-plugin-library/plugin-testing>`
|
||||
* :doc:`Quantized networks <openvino-plugin-library/advanced-guides/quantized-models>`
|
||||
* :doc:`Low precision transformations <openvino-plugin-library/advanced-guides/low-precision-transformations>` guide
|
||||
* :doc:`Writing OpenVINO™ transformations <transformations-api>` guide
|
||||
* `Integration with AUTO Plugin <https://github.com/openvinotoolkit/openvino/blob/master/src/plugins/auto/docs/integration.md>`__
|
||||
|
||||
API References
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ Advanced Topics
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
openvino_docs_ov_plugin_dg_quantized_models
|
||||
openvino_docs_OV_UG_lpt
|
||||
advanced-guides/quantized-models
|
||||
advanced-guides/low-precision-transformations
|
||||
|
||||
The guides below provides extra information about specific features of OpenVINO needed for understanding during OpenVINO plugin development:
|
||||
|
||||
* :doc:`Quantized networks <openvino_docs_ov_plugin_dg_quantized_models>`
|
||||
* :doc:`Low precision transformations guide <openvino_docs_OV_UG_lpt>`
|
||||
* :doc:`Writing OpenVINO™ transformations guide <openvino_docs_transformations>`
|
||||
* :doc:`Quantized networks <advanced-guides/quantized-models>`
|
||||
* :doc:`Low precision transformations guide <advanced-guides/low-precision-transformations>`
|
||||
* :doc:`Writing OpenVINO™ transformations guide <../transformations-api>`
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@ OpenVINO™ Low Precision Transformations
|
|||
:caption: Low Precision Transformations
|
||||
:hidden:
|
||||
|
||||
Attributes <openvino_docs_OV_UG_lpt_attributes>
|
||||
Step 1. Prerequisites transformations <openvino_docs_OV_UG_lpt_step1_prerequisites>
|
||||
Step 2. Markup transformations <openvino_docs_OV_UG_lpt_step2_markup>
|
||||
Step 3. Main transformations <openvino_docs_OV_UG_lpt_step3_main>
|
||||
Step 4. Cleanup transformations <openvino_docs_OV_UG_lpt_step4_cleanup>
|
||||
Attributes <low-precision-transformations/lpt-attributes>
|
||||
Step 1. Prerequisites transformations <low-precision-transformations/step1-prerequisites>
|
||||
Step 2. Markup transformations <low-precision-transformations/step2-markup>
|
||||
Step 3. Main transformations <low-precision-transformations/step3-main>
|
||||
Step 4. Cleanup transformations <low-precision-transformations/step4-cleanup>
|
||||
|
||||
|
||||
Introduction
|
||||
|
|
@ -43,43 +43,43 @@ Input model requirements
|
|||
|
||||
LPT transformations propagate dequantization operations through the following operations:
|
||||
|
||||
* :doc:`Add-1 <openvino_docs_ops_arithmetic_Add_1>`
|
||||
* :doc:`AvgPool-1 <openvino_docs_ops_pooling_AvgPool_1>`
|
||||
* :doc:`Clamp-1 <openvino_docs_ops_activation_Clamp_1>`
|
||||
* :doc:`Concat-1 <openvino_docs_ops_movement_Concat_1>`
|
||||
* :doc:`Convolution-1 <openvino_docs_ops_convolution_Convolution_1>`
|
||||
* :doc:`ConvolutionBackpropData-1 <openvino_docs_ops_convolution_ConvolutionBackpropData_1>`
|
||||
* :doc:`DepthToSpace-1 <openvino_docs_ops_movement_DepthToSpace_1>`
|
||||
* :doc:`FakeQuantize-1 <openvino_docs_ops_quantization_FakeQuantize_1>`
|
||||
* :doc:`GroupConvolution-1 <openvino_docs_ops_convolution_GroupConvolution_1>`
|
||||
* :doc:`Interpolate-1 <openvino_docs_ops_image_Interpolate_1>`
|
||||
* :doc:`Interpolate-4 <openvino_docs_ops_image_Interpolate_4>`
|
||||
* :doc:`MatMul-1 <openvino_docs_ops_matrix_MatMul_1>`
|
||||
* :doc:`MaxPool-1 <openvino_docs_ops_pooling_MaxPool_1>`
|
||||
* :doc:`Multiply-1 <openvino_docs_ops_arithmetic_Multiply_1>`
|
||||
* :doc:`MVN-1 <openvino_docs_ops_normalization_MVN_1>`
|
||||
* :doc:`NormalizeL2-1 <openvino_docs_ops_normalization_NormalizeL2_1>`
|
||||
* :doc:`PRelu-1 <openvino_docs_ops_activation_PReLU_1>`
|
||||
* :doc:`ReduceMax-1 <openvino_docs_ops_reduction_ReduceMax_1>`
|
||||
* :doc:`ReduceMean-1 <openvino_docs_ops_reduction_ReduceMean_1>`
|
||||
* :doc:`ReduceMin-1 <openvino_docs_ops_reduction_ReduceMin_1>`
|
||||
* :doc:`ReduceSum-1 <openvino_docs_ops_reduction_ReduceSum_1>`
|
||||
* :doc:`Relu-1 <openvino_docs_ops_activation_ReLU_1>`
|
||||
* :doc:`Reshape-1 <openvino_docs_ops_shape_Reshape_1>`
|
||||
* :doc:`Split-1 <openvino_docs_ops_movement_Split_1>`
|
||||
* :doc:`Squeeze-1 <openvino_docs_ops_shape_Reshape_1>`
|
||||
* :doc:`StridedSlice-1 <openvino_docs_ops_movement_StridedSlice_1>`
|
||||
* :doc:`Transpose-1 <openvino_docs_ops_movement_Transpose_1>`
|
||||
* :doc:`Gather-7 <openvino_docs_ops_movement_Gather_7>`
|
||||
* :doc:`Gather-8 <openvino_docs_ops_movement_Gather_8>`
|
||||
* :doc:`Unsqueeze-1 <openvino_docs_ops_shape_Unsqueeze_1>`
|
||||
* :doc:`VariadicSplit-1 <openvino_docs_ops_movement_VariadicSplit_1>`
|
||||
* :doc:`Add-1 <../../../openvino-ir-format/operation-sets/operations-specifications/arithmetic/add-1>`
|
||||
* :doc:`AvgPool-1 <../../../openvino-ir-format/operation-sets/operations-specifications/pooling/avg-pool-1>`
|
||||
* :doc:`Clamp-1 <../../../openvino-ir-format/operation-sets/operations-specifications/activation/clamp-1>`
|
||||
* :doc:`Concat-1 <../../../openvino-ir-format/operation-sets/operations-specifications/movement/concat-1>`
|
||||
* :doc:`Convolution-1 <../../../openvino-ir-format/operation-sets/operations-specifications/convolution/convolution-1>`
|
||||
* :doc:`ConvolutionBackpropData-1 <../../../openvino-ir-format/operation-sets/operations-specifications/convolution/convolution-backprop-data-1>`
|
||||
* :doc:`DepthToSpace-1 <../../../openvino-ir-format/operation-sets/operations-specifications/movement/depth-to-space-1>`
|
||||
* :doc:`FakeQuantize-1 <../../../openvino-ir-format/operation-sets/operations-specifications/quantization/fake-quantize-1>`
|
||||
* :doc:`GroupConvolution-1 <../../../openvino-ir-format/operation-sets/operations-specifications/convolution/group-convolution-1>`
|
||||
* :doc:`Interpolate-1 <../../../openvino-ir-format/operation-sets/operations-specifications/image/interpolate-1>`
|
||||
* :doc:`Interpolate-4 <../../../openvino-ir-format/operation-sets/operations-specifications/image/interpolate-4>`
|
||||
* :doc:`MatMul-1 <../../../openvino-ir-format/operation-sets/operations-specifications/matrix/matmul-1>`
|
||||
* :doc:`MaxPool-1 <../../../openvino-ir-format/operation-sets/operations-specifications/pooling/max-pool-1>`
|
||||
* :doc:`Multiply-1 <../../../openvino-ir-format/operation-sets/operations-specifications/arithmetic/multiply-1>`
|
||||
* :doc:`MVN-1 <../../../openvino-ir-format/operation-sets/operations-specifications/normalization/mvn-1>`
|
||||
* :doc:`NormalizeL2-1 <../../../openvino-ir-format/operation-sets/operations-specifications/normalization/normalize-l2-1>`
|
||||
* :doc:`PRelu-1 <../../../openvino-ir-format/operation-sets/operations-specifications/activation/prelu-1>`
|
||||
* :doc:`ReduceMax-1 <../../../openvino-ir-format/operation-sets/operations-specifications/reduction/reduce-max-1>`
|
||||
* :doc:`ReduceMean-1 <../../../openvino-ir-format/operation-sets/operations-specifications/reduction/reduce-mean-1>`
|
||||
* :doc:`ReduceMin-1 <../../../openvino-ir-format/operation-sets/operations-specifications/reduction/reduce-min-1>`
|
||||
* :doc:`ReduceSum-1 <../../../openvino-ir-format/operation-sets/operations-specifications/reduction/reduce-sum-1>`
|
||||
* :doc:`Relu-1 <../../../openvino-ir-format/operation-sets/operations-specifications/activation/relu-1>`
|
||||
* :doc:`Reshape-1 <../../../openvino-ir-format/operation-sets/operations-specifications/shape/reshape-1>`
|
||||
* :doc:`Split-1 <../../../openvino-ir-format/operation-sets/operations-specifications/movement/split-1>`
|
||||
* :doc:`Squeeze-1 <../../../openvino-ir-format/operation-sets/operations-specifications/shape/reshape-1>`
|
||||
* :doc:`StridedSlice-1 <../../../openvino-ir-format/operation-sets/operations-specifications/movement/strided-slice-1>`
|
||||
* :doc:`Transpose-1 <../../../openvino-ir-format/operation-sets/operations-specifications/movement/transpose-1>`
|
||||
* :doc:`Gather-7 <../../../openvino-ir-format/operation-sets/operations-specifications/movement/gather-7>`
|
||||
* :doc:`Gather-8 <../../../openvino-ir-format/operation-sets/operations-specifications/movement/gather-8>`
|
||||
* :doc:`Unsqueeze-1 <../../../openvino-ir-format/operation-sets/operations-specifications/shape/unsqueeze-1>`
|
||||
* :doc:`VariadicSplit-1 <../../../openvino-ir-format/operation-sets/operations-specifications/movement/variadic-split-1>`
|
||||
|
||||
If operation is not supported by LPT then dequantization operation will not be propagated, input tensor precisions will not be changed to low precision and operation will be executed in original precision.
|
||||
|
||||
For example, if you would like to infer a model with ``Convolution`` operation in low precision then the model can look as on picture below:
|
||||
|
||||
.. image:: _static/images/model_fq_and_convolution.common.svg
|
||||
.. image:: ../../../../_static/images/model_fq_and_convolution.common.svg
|
||||
:alt: Quantized Convolution
|
||||
|
||||
There are several supported quantization approaches on activations and on weights. All supported approaches are described in `Quantization approaches <#quantization-approaches>`__ section below. In demonstrated model `FakeQuantize operation quantization <#fakequantize-operation>`__ approach is used.
|
||||
|
|
@ -87,7 +87,7 @@ There are several supported quantization approaches on activations and on weight
|
|||
Low precision tools
|
||||
+++++++++++++++++++
|
||||
|
||||
For more details on how to get a quantized model, refer to :doc:`Model Optimization <openvino_docs_model_optimization_guide>` document.
|
||||
For more details on how to get a quantized model, refer to :doc:`Model Optimization <../../../../openvino-workflow/model-optimization>` document.
|
||||
|
||||
Quantization approaches
|
||||
#######################
|
||||
|
|
@ -104,7 +104,7 @@ FakeQuantize operation
|
|||
|
||||
In this case ``FakeQuantize`` operation is used on activations and quantized constant on weights. Original input model:
|
||||
|
||||
.. image:: _static/images/model_fq_and_convolution.common.svg
|
||||
.. image:: ../../../../_static/images/model_fq_and_convolution.common.svg
|
||||
:alt: Original model with FakeQuantize
|
||||
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ Quantize and dequantization operations
|
|||
|
||||
In this case ``FakeQuantize`` operation and ``Convert`` are used as quantize operation and return quantized low precision tensor. After quantize operation on activations there are ``Convert`` and dequantization operations to compensate decomposition. Original input model:
|
||||
|
||||
.. image:: _static/images/model_qdq_and_convolution.common.svg
|
||||
.. image:: ../../../../_static/images/model_qdq_and_convolution.common.svg
|
||||
:alt: Original model with Q/DQ
|
||||
|
||||
In both cases result is the same. In LPT result model you can see that:
|
||||
|
|
@ -129,7 +129,7 @@ In both cases result is the same. In LPT result model you can see that:
|
|||
|
||||
LPT result model:
|
||||
|
||||
.. image:: _static/images/model_fq_and_convolution.transformed.svg
|
||||
.. image:: ../../../../_static/images/model_fq_and_convolution.transformed.svg
|
||||
:alt: Result model
|
||||
|
||||
Low precision transformations pipeline
|
||||
|
|
@ -137,7 +137,7 @@ Low precision transformations pipeline
|
|||
|
||||
LPT transformation pipeline has several steps. For each transformation inside one step pattern matcher is unique per transformation, but each operation can be assigned to several transformations.
|
||||
|
||||
.. image:: _static/images/low_precision_transformation_pipeline.svg
|
||||
.. image:: ../../../../_static/images/low_precision_transformation_pipeline.svg
|
||||
:alt: Low precision transformations pipeline
|
||||
|
||||
Inside each step LPT transformations handle input model operation by operation, applying transformation matching pattern for each transformation from the step to an operation, and execute transformation if pattern is matched. Decomposition transformation decomposes ``FakeQuantize`` to quantize and dequantization operations. Dequantization operations from previous transformation result is used for the current one and so on, until the end of the model is achieved.
|
||||
|
|
@ -146,78 +146,78 @@ As result, usually all operations are inferred by plugin in low precision. If pl
|
|||
|
||||
Low precision transformations pipeline includes four steps:
|
||||
|
||||
* :doc:`Step 1: Prerequisites <openvino_docs_OV_UG_lpt_step1_prerequisites>`
|
||||
* :doc:`Step 2: Markup transformations <openvino_docs_OV_UG_lpt_step2_markup>`
|
||||
* :doc:`Step 3: Main transformations <openvino_docs_OV_UG_lpt_step3_main>`
|
||||
* :doc:`Step 4: Cleanup transformations <openvino_docs_OV_UG_lpt_step4_cleanup>`
|
||||
* :doc:`Step 1: Prerequisites <low-precision-transformations/step1-prerequisites>`
|
||||
* :doc:`Step 2: Markup transformations <low-precision-transformations/step2-markup>`
|
||||
* :doc:`Step 3: Main transformations <low-precision-transformations/step3-main>`
|
||||
* :doc:`Step 4: Cleanup transformations <low-precision-transformations/step4-cleanup>`
|
||||
|
||||
Step 1. Prerequisites
|
||||
---------------------
|
||||
|
||||
This step fuses and propagates some operations in the model to prepare for the next step. It is required for OpenVINO plugins. Transformations:
|
||||
|
||||
* :doc:`PullReshapeThroughDequantization <openvino_docs_OV_UG_lpt_PullReshapeThroughDequantization>`
|
||||
* :doc:`PullTransposeThroughDequantization <openvino_docs_OV_UG_lpt_PullTransposeThroughDequantization>`
|
||||
* :doc:`LinOpSequenceFusion <openvino_docs_OV_UG_lpt_LinOpSequenceFusion>`
|
||||
* :doc:`PullReshapeThroughDequantization <low-precision-transformations/step1-prerequisites/pull-reshape-through-dequantization>`
|
||||
* :doc:`PullTransposeThroughDequantization <low-precision-transformations/step1-prerequisites/pull-transpose-through-dequantization>`
|
||||
* :doc:`LinOpSequenceFusion <low-precision-transformations/step1-prerequisites/lin-op-sequence-fusion>`
|
||||
|
||||
The model on this step is changed. There are more details in developer guide :doc:`Prerequisites transformations <openvino_docs_OV_UG_lpt_step1_prerequisites>`.
|
||||
The model on this step is changed. There are more details in developer guide :doc:`Prerequisites transformations <low-precision-transformations/step1-prerequisites>`.
|
||||
|
||||
Step 2. Markup
|
||||
--------------
|
||||
|
||||
This step creates runtime attributes for operations. These attributes will be used in next step. Transformations:
|
||||
|
||||
* :doc:`MarkupBias <openvino_docs_OV_UG_lpt_MarkupBias>`
|
||||
* :doc:`MarkupCanBeQuantized <openvino_docs_OV_UG_lpt_MarkupCanBeQuantized>`
|
||||
* :doc:`MarkupPrecisions <openvino_docs_OV_UG_lpt_MarkupPrecisions>`
|
||||
* :doc:`MarkupPerTensorQuantization <openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization>`
|
||||
* :doc:`MarkupAvgPoolPrecisionPreserved <openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved>`
|
||||
* :doc:`PropagatePrecisions <openvino_docs_OV_UG_lpt_PropagatePrecisions>`
|
||||
* :doc:`AlignQuantizationIntervals <openvino_docs_OV_UG_lpt_AlignQuantizationIntervals>`
|
||||
* :doc:`AlignQuantizationParameters <openvino_docs_OV_UG_lpt_AlignQuantizationParameters>`
|
||||
* :doc:`MarkupBias <low-precision-transformations/step2-markup/markup-bias>`
|
||||
* :doc:`MarkupCanBeQuantized <low-precision-transformations/step2-markup/markup-can-be-quantized>`
|
||||
* :doc:`MarkupPrecisions <low-precision-transformations/step2-markup/markup-precisions>`
|
||||
* :doc:`MarkupPerTensorQuantization <low-precision-transformations/step2-markup/markup-per-tensor-quantization>`
|
||||
* :doc:`MarkupAvgPoolPrecisionPreserved <low-precision-transformations/step2-markup/markup-avg-pool-precision-preserved>`
|
||||
* :doc:`PropagatePrecisions <low-precision-transformations/step2-markup/propagate-precisions>`
|
||||
* :doc:`AlignQuantizationIntervals <low-precision-transformations/step2-markup/align-quantization-intervals>`
|
||||
* :doc:`AlignQuantizationParameters <low-precision-transformations/step2-markup/align-quantization-parameters>`
|
||||
|
||||
The model on this step is changed: only new attributes are added to some operations. There are more details in developer guide :doc:`Markup transformations <openvino_docs_OV_UG_lpt_step2_markup>`.
|
||||
The model on this step is changed: only new attributes are added to some operations. There are more details in developer guide :doc:`Markup transformations <low-precision-transformations/step2-markup>`.
|
||||
|
||||
Step 3. Main transformations, FakeQuantize decomposition and dequantization operations handling
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
This step has the most transformations. These transformations can be separated in two groups: decomposition transformation and dequantization operations handling. There are more details in developer guide :doc:`Main transformations <openvino_docs_OV_UG_lpt_step3_main>`.
|
||||
This step has the most transformations. These transformations can be separated in two groups: decomposition transformation and dequantization operations handling. There are more details in developer guide :doc:`Main transformations <low-precision-transformations/step3-main>`.
|
||||
|
||||
Transformations:
|
||||
|
||||
* :doc:`AddTransformation <openvino_docs_OV_UG_lpt_AddTransformation>`
|
||||
* :doc:`AvgPoolTransformation <openvino_docs_OV_UG_lpt_AvgPoolTransformation>`
|
||||
* :doc:`ClampTransformation <openvino_docs_OV_UG_lpt_AvgPoolTransformation>`
|
||||
* :doc:`BatchToSpaceTransformation <openvino_docs_OV_UG_lpt_BatchToSpaceTransformation>`
|
||||
* :doc:`ConcatTransformation <openvino_docs_OV_UG_lpt_ConcatTransformation>`
|
||||
* :doc:`ConvolutionTransformation <openvino_docs_OV_UG_lpt_ConvolutionTransformation>`
|
||||
* :doc:`ConvolutionBackpropDataTransformation <openvino_docs_OV_UG_lpt_ConvolutionBackpropDataTransformation>`
|
||||
* :doc:`DepthToSpaceTransformation <openvino_docs_OV_UG_lpt_DepthToSpaceTransformation>`
|
||||
* :doc:`FakeQuantizeDecompositionTransformation <openvino_docs_OV_UG_lpt_FakeQuantizeDecompositionTransformation>`
|
||||
* :doc:`FakeQuantizeTransformation <openvino_docs_OV_UG_lpt_FakeQuantizeTransformation>`
|
||||
* :doc:`InterpolateTransformation <openvino_docs_OV_UG_lpt_InterpolateTransformation>`
|
||||
* :doc:`GroupConvolutionTransformation <openvino_docs_OV_UG_lpt_GroupConvolutionTransformation>`
|
||||
* :doc:`GatherTransformation <openvino_docs_OV_UG_lpt_GatherTransformation>`
|
||||
* :doc:`MatMulTransformation <openvino_docs_OV_UG_lpt_MatMulTransformation>`
|
||||
* :doc:`MaxPoolTransformation <openvino_docs_OV_UG_lpt_MaxPoolTransformation>`
|
||||
* :doc:`MultiplyPartialTransformation <openvino_docs_OV_UG_lpt_MultiplyPartialTransformation>`
|
||||
* :doc:`MVNTransformation <openvino_docs_OV_UG_lpt_MVNTransformation>`
|
||||
* :doc:`NormalizeL2Transformation <openvino_docs_OV_UG_lpt_NormalizeL2Transformation>`
|
||||
* :doc:`PReluTransformation <openvino_docs_OV_UG_lpt_PReluTransformation>`
|
||||
* :doc:`ReduceMaxTransformation <openvino_docs_OV_UG_lpt_ReduceMaxTransformation>`
|
||||
* :doc:`ReduceMeanTransformation <openvino_docs_OV_UG_lpt_ReduceMeanTransformation>`
|
||||
* :doc:`ReduceMinTransformation <openvino_docs_OV_UG_lpt_ReduceMinTransformation>`
|
||||
* :doc:`ReduceSumTransformation <openvino_docs_OV_UG_lpt_ReduceSumTransformation>`
|
||||
* :doc:`ReluTransformation <openvino_docs_OV_UG_lpt_ReluTransformation>`
|
||||
* :doc:`ReshapeTransformation <openvino_docs_OV_UG_lpt_ReshapeTransformation>`
|
||||
* :doc:`SqueezeTransformation <openvino_docs_OV_UG_lpt_SqueezeTransformation>`
|
||||
* :doc:`ShuffleChannelsTransformation <openvino_docs_OV_UG_lpt_ShuffleChannelsTransformation>`
|
||||
* :doc:`SpaceToBatchTransformation <openvino_docs_OV_UG_lpt_SpaceToBatchTransformation>`
|
||||
* :doc:`SplitTransformation <openvino_docs_OV_UG_lpt_SplitTransformation>`
|
||||
* :doc:`StridedSliceTransformation <openvino_docs_OV_UG_lpt_StridedSliceTransformation>`
|
||||
* :doc:`TransposeTransformation <openvino_docs_OV_UG_lpt_TransposeTransformation>`
|
||||
* :doc:`UnsqueezeTransformation <openvino_docs_OV_UG_lpt_UnsqueezeTransformation>`
|
||||
* :doc:`VariadicSplitTransformation <openvino_docs_OV_UG_lpt_VariadicSplitTransformation>`
|
||||
* :doc:`AddTransformation <low-precision-transformations/step3-main/arithmetic/add>`
|
||||
* :doc:`AvgPoolTransformation <low-precision-transformations/step3-main/pooling/avg-pool>`
|
||||
* :doc:`ClampTransformation <low-precision-transformations/step3-main/pooling/avg-pool>`
|
||||
* :doc:`BatchToSpaceTransformation <low-precision-transformations/step3-main/shape/batch-to-space>`
|
||||
* :doc:`ConcatTransformation <low-precision-transformations/step3-main/movement/concat>`
|
||||
* :doc:`ConvolutionTransformation <low-precision-transformations/step3-main/convolution/convolution>`
|
||||
* :doc:`ConvolutionBackpropDataTransformation <low-precision-transformations/step3-main/convolution/convolution-backprop-data>`
|
||||
* :doc:`DepthToSpaceTransformation <low-precision-transformations/step3-main/movement/depth-to-space>`
|
||||
* :doc:`FakeQuantizeDecompositionTransformation <low-precision-transformations/step4-cleanup/fake-quantize-decomposition>`
|
||||
* :doc:`FakeQuantizeTransformation <low-precision-transformations/step3-main/quantization/fake-quantize>`
|
||||
* :doc:`InterpolateTransformation <low-precision-transformations/step3-main/image/interpolate>`
|
||||
* :doc:`GroupConvolutionTransformation <low-precision-transformations/step3-main/convolution/group-convolution>`
|
||||
* :doc:`GatherTransformation <low-precision-transformations/step3-main/movement/gather>`
|
||||
* :doc:`MatMulTransformation <low-precision-transformations/step3-main/matrix/mat-mul>`
|
||||
* :doc:`MaxPoolTransformation <low-precision-transformations/step3-main/pooling/max-pool>`
|
||||
* :doc:`MultiplyPartialTransformation <low-precision-transformations/step3-main/arithmetic/multiply-partial>`
|
||||
* :doc:`MVNTransformation <low-precision-transformations/step3-main/normalization/mvn>`
|
||||
* :doc:`NormalizeL2Transformation <low-precision-transformations/step3-main/normalization/normalize-l2>`
|
||||
* :doc:`PReluTransformation <low-precision-transformations/step3-main/activation/prelu>`
|
||||
* :doc:`ReduceMaxTransformation <low-precision-transformations/step3-main/reduction/reduce-max>`
|
||||
* :doc:`ReduceMeanTransformation <low-precision-transformations/step3-main/reduction/reduce-mean>`
|
||||
* :doc:`ReduceMinTransformation <low-precision-transformations/step3-main/reduction/reduce-min>`
|
||||
* :doc:`ReduceSumTransformation <low-precision-transformations/step3-main/reduction/reduce-sum>`
|
||||
* :doc:`ReluTransformation <low-precision-transformations/step3-main/activation/relu>`
|
||||
* :doc:`ReshapeTransformation <low-precision-transformations/step3-main/shape/reshape>`
|
||||
* :doc:`SqueezeTransformation <low-precision-transformations/step3-main/shape/squeeze>`
|
||||
* :doc:`ShuffleChannelsTransformation <low-precision-transformations/step3-main/movement/shuffle-channels>`
|
||||
* :doc:`SpaceToBatchTransformation <low-precision-transformations/step3-main/shape/space-to-batch>`
|
||||
* :doc:`SplitTransformation <low-precision-transformations/step3-main/movement/split>`
|
||||
* :doc:`StridedSliceTransformation <low-precision-transformations/step3-main/movement/strided-slice>`
|
||||
* :doc:`TransposeTransformation <low-precision-transformations/step3-main/movement/transpose>`
|
||||
* :doc:`UnsqueezeTransformation <low-precision-transformations/step3-main/shape/unsqueeze>`
|
||||
* :doc:`VariadicSplitTransformation <low-precision-transformations/step3-main/movement/variadic-split>`
|
||||
|
||||
Decomposition transformations
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
@ -227,12 +227,12 @@ Decomposition transformations decompose the ``FakeQuantize`` operation to: quant
|
|||
|
||||
Original ``FakeQuantize``:
|
||||
|
||||
.. image:: _static/images/fq.common.svg
|
||||
.. image:: ../../../../_static/images/fq.common.svg
|
||||
:alt: FakeQuantize operation before LPT
|
||||
|
||||
``FakeQuantize`` after decomposition to quantization and dequantization operations:
|
||||
|
||||
.. image:: _static/images/fq.transformed.svg
|
||||
.. image:: ../../../../_static/images/fq.transformed.svg
|
||||
:alt: FakeQuantize operation after LPT
|
||||
|
||||
Dequantization operations handling transformations
|
||||
|
|
@ -242,12 +242,12 @@ In this step, LPT transformations fuse dequantization operations or move them th
|
|||
|
||||
Original ``Convolution`` operation in FP32 with dequantization operations before:
|
||||
|
||||
.. image:: _static/images/model_fq_and_convolution.common.svg
|
||||
.. image:: ../../../../_static/images/model_fq_and_convolution.common.svg
|
||||
:alt: Convolution operation before LPT
|
||||
|
||||
``Convolution`` operation in INT8 after decomposition and dequantization operations handling:
|
||||
|
||||
.. image:: _static/images/model_fq_and_convolution.transformed.svg
|
||||
.. image:: ../../../../_static/images/model_fq_and_convolution.transformed.svg
|
||||
:alt: Convolution operation after LPT
|
||||
|
||||
|
||||
|
|
@ -258,24 +258,24 @@ LPT cleanup transformations is final stage in LPT pipeline. In this step LPT tra
|
|||
|
||||
Transformations:
|
||||
|
||||
* :doc:`EliminateFakeQuantizeTransformation <openvino_docs_OV_UG_lpt_EliminateFakeQuantizeTransformation>`
|
||||
* :doc:`FoldConvertTransformation <openvino_docs_OV_UG_lpt_FoldConvertTransformation>`
|
||||
* :doc:`FoldFakeQuantizeTransformation <openvino_docs_OV_UG_lpt_FoldFakeQuantizeTransformation>`
|
||||
* :doc:`FuseConvertTransformation <openvino_docs_OV_UG_lpt_FuseConvertTransformation>`
|
||||
* :doc:`FuseMultiplyToFakeQuantizeTransformation <openvino_docs_OV_UG_lpt_FuseMultiplyToFakeQuantizeTransformation>`
|
||||
* :doc:`FuseSubtractToFakeQuantizeTransformation <openvino_docs_OV_UG_lpt_FuseSubtractToFakeQuantizeTransformation>`
|
||||
* :doc:`MultiplyToGroupConvolutionTransformation <openvino_docs_OV_UG_lpt_MultiplyToGroupConvolutionTransformation>`
|
||||
* :doc:`EliminateFakeQuantizeTransformation <low-precision-transformations/step4-cleanup/eliminate-fake-quantize>`
|
||||
* :doc:`FoldConvertTransformation <low-precision-transformations/step4-cleanup/fold-convert>`
|
||||
* :doc:`FoldFakeQuantizeTransformation <low-precision-transformations/step3-main/quantization/fold-fake-quantize>`
|
||||
* :doc:`FuseConvertTransformation <low-precision-transformations/step4-cleanup/fuse-convert>`
|
||||
* :doc:`FuseMultiplyToFakeQuantizeTransformation <low-precision-transformations/step4-cleanup/fuse-multiply-to-fake-quantize>`
|
||||
* :doc:`FuseSubtractToFakeQuantizeTransformation <low-precision-transformations/step4-cleanup/fuse-subtract-to-fake-quantize>`
|
||||
* :doc:`MultiplyToGroupConvolutionTransformation <low-precision-transformations/step4-cleanup/multiply-to-group-convolution>`
|
||||
|
||||
There are more details in developer guide :doc:`Cleanup transformations <openvino_docs_OV_UG_lpt_step4_cleanup>`.
|
||||
There are more details in developer guide :doc:`Cleanup transformations <low-precision-transformations/step4-cleanup>`.
|
||||
|
||||
``FakeQuantize`` operation with not handled dequantization operations:
|
||||
|
||||
.. image:: _static/images/fq.transformed.svg
|
||||
.. image:: ../../../../_static/images/fq.transformed.svg
|
||||
:alt: TODO: FakeQuantize operation with dequantization operations before LPT
|
||||
|
||||
``FakeQuantize`` operation with fused dequantization operations:
|
||||
|
||||
.. image:: _static/images/fq.common.svg
|
||||
.. image:: ../../../../_static/images/fq.common.svg
|
||||
:alt: TODO: FakeQuantize operation with fused operations after LPT
|
||||
|
||||
|
||||
|
|
@ -313,13 +313,13 @@ This step is optional. It modifies the transformation function to a device-speci
|
|||
Result model overview
|
||||
#####################
|
||||
|
||||
Let's explore quantized `TensorFlow implementation of ResNet-50 <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf>`__ model. Use :doc:`Model Downloader <omz_tools_downloader>` tool to download the ``fp16`` model from `OpenVINO™ Toolkit - Open Model Zoo repository <https://github.com/openvinotoolkit/open_model_zoo>`__:
|
||||
Let's explore quantized `TensorFlow implementation of ResNet-50 <https://github.com/openvinotoolkit/open_../../../legacy-features/model-zoo/tree/master/models/public/resnet-50-tf>`__ model. Use :doc:`Model Downloader <../../../../omz_tools_downloader>` tool to download the ``fp16`` model from `OpenVINO™ Toolkit - Open Model Zoo repository <https://github.com/openvinotoolkit/open_../../../legacy-features/model-zoo>`__:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
omz_downloader --name resnet-50-tf --precisions FP16-INT8
|
||||
|
||||
After that you should quantize model by the :doc:`Model Quantizer <omz_tools_downloader>` tool.
|
||||
After that you should quantize model by the :doc:`Model Quantizer <../../../../omz_tools_downloader>` tool.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ After that you should quantize model by the :doc:`Model Quantizer <omz_tools_dow
|
|||
Inference
|
||||
+++++++++
|
||||
|
||||
The simplest way to infer the model and collect performance counters is :doc:`Benchmark Application <openvino_sample_benchmark_tool>`.
|
||||
The simplest way to infer the model and collect performance counters is :doc:`Benchmark Application <../../../../learn-openvino/openvino-samples/benchmark-tool>`.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ Result model depends on different factors:
|
|||
|
||||
|
||||
Information about layer precision is stored in the performance counters that are
|
||||
available from the OpenVINO Runtime API. For example, the part of performance counters table for quantized `TensorFlow implementation of ResNet-50 <https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/resnet-50-tf>`__ model inference on CPU Plugin looks as follows:
|
||||
available from the OpenVINO Runtime API. For example, the part of performance counters table for quantized `TensorFlow implementation of ResNet-50 <https://github.com/openvinotoolkit/open_../../../legacy-features/model-zoo/tree/master/models/public/resnet-50-tf>`__ model inference on CPU Plugin looks as follows:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_attributes}
|
||||
.. {#../low-precision-transformations_attributes}
|
||||
|
||||
Attributes
|
||||
==========
|
||||
|
|
@ -13,12 +13,12 @@ Attributes
|
|||
:caption: Attributes
|
||||
:hidden:
|
||||
|
||||
AvgPoolPrecisionPreserved <openvino_docs_OV_UG_lpt_AvgPoolPrecisionPreserved>
|
||||
IntervalsAlignment <openvino_docs_OV_UG_lpt_IntervalsAlignment>
|
||||
PrecisionPreserved <openvino_docs_OV_UG_lpt_PrecisionPreserved>
|
||||
Precisions <openvino_docs_OV_UG_lpt_Precisions>
|
||||
QuantizationAlignment <openvino_docs_OV_UG_lpt_QuantizationAlignment>
|
||||
QuantizationGranularity <openvino_docs_OV_UG_lpt_QuantizationGranularity>
|
||||
AvgPoolPrecisionPreserved <lpt-attributes/avg-pool-precision-preserved>
|
||||
IntervalsAlignment <lpt-attributes/intervals-alignment>
|
||||
PrecisionPreserved <lpt-attributes/precision-preserved>
|
||||
Precisions <lpt-attributes/precisions>
|
||||
QuantizationAlignment <lpt-attributes/quantization-alignment>
|
||||
QuantizationGranularity <lpt-attributes/quantization-granularity>
|
||||
|
||||
Introduction
|
||||
############
|
||||
|
|
@ -30,27 +30,27 @@ Introduction
|
|||
- Target
|
||||
- Required
|
||||
- Mutable
|
||||
* - :doc:`AvgPoolPrecisionPreserved <openvino_docs_OV_UG_lpt_AvgPoolPrecisionPreserved>`
|
||||
* - :doc:`AvgPoolPrecisionPreserved <lpt-attributes/avg-pool-precision-preserved>`
|
||||
- Precision
|
||||
- No
|
||||
- Yes
|
||||
* - :doc:`IntervalsAlignment <openvino_docs_OV_UG_lpt_IntervalsAlignment>`
|
||||
* - :doc:`IntervalsAlignment <lpt-attributes/intervals-alignment>`
|
||||
- Quantization interval
|
||||
- Yes
|
||||
- Yes
|
||||
* - :doc:`PrecisionPreserved <openvino_docs_OV_UG_lpt_PrecisionPreserved>`
|
||||
* - :doc:`PrecisionPreserved <lpt-attributes/precision-preserved>`
|
||||
- Precision
|
||||
- Yes
|
||||
- Yes
|
||||
* - :doc:`Precisions <openvino_docs_OV_UG_lpt_Precisions>`
|
||||
* - :doc:`Precisions <lpt-attributes/precisions>`
|
||||
- Precision
|
||||
- Yes
|
||||
- Yes
|
||||
* - :doc:`QuantizationAlignment <openvino_docs_OV_UG_lpt_QuantizationAlignment>`
|
||||
* - :doc:`QuantizationAlignment <lpt-attributes/quantization-alignment>`
|
||||
- Quantization granularity
|
||||
- Yes
|
||||
- Yes
|
||||
* - :doc:`QuantizationGranularity <openvino_docs_OV_UG_lpt_QuantizationGranularity>`
|
||||
* - :doc:`QuantizationGranularity <lpt-attributes/quantization-granularity>`
|
||||
- Quantization granularity
|
||||
- Yes
|
||||
- No
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_AvgPoolPrecisionPreserved}
|
||||
.. {#../../low-precision-transformations_AvgPoolPrecisionPreserved}
|
||||
|
||||
AvgPoolPrecisionPreserved Attribute
|
||||
===================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_IntervalsAlignment}
|
||||
.. {#../../low-precision-transformations_IntervalsAlignment}
|
||||
|
||||
IntervalsAlignment Attribute
|
||||
============================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_PrecisionPreserved}
|
||||
.. {#../../low-precision-transformations_PrecisionPreserved}
|
||||
|
||||
PrecisionPreserved Attribute
|
||||
============================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_Precisions}
|
||||
.. {#../../low-precision-transformations_Precisions}
|
||||
|
||||
Precisions Attribute
|
||||
====================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_QuantizationAlignment}
|
||||
.. {#../../low-precision-transformations_QuantizationAlignment}
|
||||
|
||||
QuantizationAlignment Attribute
|
||||
===============================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_QuantizationGranularity}
|
||||
.. {#../../low-precision-transformations_QuantizationGranularity}
|
||||
|
||||
QuantizationGranularity Attribute
|
||||
=================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_step1_prerequisites}
|
||||
.. {#../low-precision-transformations_step1_prerequisites}
|
||||
|
||||
Step 1. Prerequisites Transformations
|
||||
=====================================
|
||||
|
|
@ -12,13 +12,13 @@ Step 1. Prerequisites Transformations
|
|||
:maxdepth: 1
|
||||
:hidden:
|
||||
|
||||
PullReshapeThroughDequantization <openvino_docs_OV_UG_lpt_PullReshapeThroughDequantization>
|
||||
PullTransposeThroughDequantization <openvino_docs_OV_UG_lpt_PullTransposeThroughDequantization>
|
||||
LinOpSequenceFusion <openvino_docs_OV_UG_lpt_LinOpSequenceFusion>
|
||||
PullReshapeThroughDequantization <step1-prerequisites/pull-reshape-through-dequantization>
|
||||
PullTransposeThroughDequantization <step1-prerequisites/pull-transpose-through-dequantization>
|
||||
LinOpSequenceFusion <step1-prerequisites/lin-op-sequence-fusion>
|
||||
|
||||
Prerequisites transformations are optional. The transformations prepare a model before running other low precision transformations. The transformations do not operate with dequantization operations or update precisions. Prerequisites transformations include:
|
||||
|
||||
* :doc:`PullReshapeThroughDequantization <openvino_docs_OV_UG_lpt_PullReshapeThroughDequantization>`
|
||||
* :doc:`PullTransposeThroughDequantization <openvino_docs_OV_UG_lpt_PullTransposeThroughDequantization>`
|
||||
* :doc:`LinOpSequenceFusion <openvino_docs_OV_UG_lpt_LinOpSequenceFusion>`
|
||||
* :doc:`PullReshapeThroughDequantization <step1-prerequisites/lin-op-sequence-fusion>`
|
||||
* :doc:`PullTransposeThroughDequantization <step1-prerequisites/pull-transpose-through-dequantization>`
|
||||
* :doc:`LinOpSequenceFusion <step1-prerequisites/lin-op-sequence-fusion>`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_ConvertSubtractConstant}
|
||||
.. {#../../low-precision-transformations_ConvertSubtractConstant}
|
||||
|
||||
ConvertSubtractConstant transformation
|
||||
======================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_LinOpSequenceFusion}
|
||||
.. {#../../low-precision-transformations_LinOpSequenceFusion}
|
||||
|
||||
LinOpSequenceFusion transformation
|
||||
==================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_PullReshapeThroughDequantization}
|
||||
.. {#../../low-precision-transformations_PullReshapeThroughDequantization}
|
||||
|
||||
PullReshapeThroughDequantization transformation
|
||||
===============================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_PullTransposeThroughDequantization}
|
||||
.. {#../../low-precision-transformations_PullTransposeThroughDequantization}
|
||||
|
||||
PullTransposeThroughDequantization transformation
|
||||
=================================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_step2_markup}
|
||||
.. {#../low-precision-transformations_step2_markup}
|
||||
|
||||
Step 2. Markup Transformations
|
||||
==============================
|
||||
|
|
@ -13,31 +13,31 @@ Step 2. Markup Transformations
|
|||
:caption: Low Precision Transformations
|
||||
:hidden:
|
||||
|
||||
MarkupBias <openvino_docs_OV_UG_lpt_MarkupBias>
|
||||
MarkupCanBeQuantized <openvino_docs_OV_UG_lpt_MarkupCanBeQuantized>
|
||||
MarkupPrecisions <openvino_docs_OV_UG_lpt_MarkupPrecisions>
|
||||
MarkupPerTensorQuantization <openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization>
|
||||
MarkupAvgPoolPrecisionPreserved <openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved>
|
||||
PropagatePrecisions <openvino_docs_OV_UG_lpt_PropagatePrecisions>
|
||||
AlignQuantizationIntervals <openvino_docs_OV_UG_lpt_AlignQuantizationIntervals>
|
||||
AlignQuantizationParameters <openvino_docs_OV_UG_lpt_AlignQuantizationParameters>
|
||||
MarkupBias <step2-markup/markup-bias>
|
||||
MarkupCanBeQuantized <step2-markup/markup-can-be-quantized>
|
||||
MarkupPrecisions <step2-markup/markup-precisions>
|
||||
MarkupPerTensorQuantization <step2-markup/markup-per-tensor-quantization>
|
||||
MarkupAvgPoolPrecisionPreserved <step2-markup/markup-avg-pool-precision-preserved>
|
||||
PropagatePrecisions <step2-markup/propagate-precisions>
|
||||
AlignQuantizationIntervals <step2-markup/align-quantization-intervals>
|
||||
AlignQuantizationParameters <step2-markup/align-quantization-parameters>
|
||||
|
||||
CreateAttribute <openvino_docs_OV_UG_lpt_CreateAttribute>
|
||||
CreatePrecisionsDependentAttribute <openvino_docs_OV_UG_lpt_CreatePrecisionsDependentAttribute>
|
||||
PropagateThroughPrecisionPreserved <openvino_docs_OV_UG_lpt_PropagateThroughPrecisionPreserved>
|
||||
PropagateToInput <openvino_docs_OV_UG_lpt_PropagateToInput>
|
||||
UpdateSharedPrecisionPreserved <openvino_docs_OV_UG_lpt_UpdateSharedPrecisionPreserved>
|
||||
CreateAttribute <step2-markup/create-attribute>
|
||||
CreatePrecisionsDependentAttribute <step2-markup/create-precisions-dependent-attribute>
|
||||
PropagateThroughPrecisionPreserved <step2-markup/propagate-through-precision-preserved>
|
||||
PropagateToInput <step2-markup/propagate-to-input>
|
||||
UpdateSharedPrecisionPreserved <step2-markup/update-shared-precision-preserved>
|
||||
|
||||
This step defines the optimal ``FakeQuantize`` decomposition precisions for the best inference performance via operations markup with runtime attribute instances. Attributes are created for input and output ports and operations. Transformations do not change the operation output port precisions. A model markup low precision logic is decomposed and implemented into the following common markup transformations. The order of transformations is important:
|
||||
|
||||
1. :doc:`MarkupBias <openvino_docs_OV_UG_lpt_MarkupBias>`
|
||||
2. :doc:`MarkupCanBeQuantized <openvino_docs_OV_UG_lpt_MarkupCanBeQuantized>`
|
||||
3. :doc:`MarkupPrecisions <openvino_docs_OV_UG_lpt_MarkupPrecisions>`
|
||||
4. :doc:`MarkupPerTensorQuantization <openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization>`
|
||||
5. :doc:`MarkupAvgPoolPrecisionPreserved <openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved>`
|
||||
6. :doc:`PropagatePrecisions <openvino_docs_OV_UG_lpt_PropagatePrecisions>`
|
||||
7. :doc:`AlignQuantizationIntervals <openvino_docs_OV_UG_lpt_AlignQuantizationIntervals>`
|
||||
8. :doc:`AlignQuantizationParameters <openvino_docs_OV_UG_lpt_AlignQuantizationParameters>`
|
||||
1. :doc:`MarkupBias <step2-markup/markup-bias>`
|
||||
2. :doc:`MarkupCanBeQuantized <step2-markup/markup-can-be-quantized>`
|
||||
3. :doc:`MarkupPrecisions <step2-markup/markup-precisions>`
|
||||
4. :doc:`MarkupPerTensorQuantization <step2-markup/markup-per-tensor-quantization>`
|
||||
5. :doc:`MarkupAvgPoolPrecisionPreserved <step2-markup/markup-avg-pool-precision-preserved>`
|
||||
6. :doc:`PropagatePrecisions <step2-markup/propagate-precisions>`
|
||||
7. :doc:`AlignQuantizationIntervals <step2-markup/align-quantization-intervals>`
|
||||
8. :doc:`AlignQuantizationParameters <step2-markup/align-quantization-parameters>`
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
|
@ -75,15 +75,15 @@ This step defines the optimal ``FakeQuantize`` decomposition precisions for the
|
|||
|
||||
Common markup transformations can be decomposed into simpler utility markup transformations. The order of Markup utility transformations is not important:
|
||||
|
||||
* :doc:`CreateAttribute <openvino_docs_OV_UG_lpt_CreateAttribute>`
|
||||
* :doc:`CreatePrecisionsDependentAttribute <openvino_docs_OV_UG_lpt_CreatePrecisionsDependentAttribute>`
|
||||
* :doc:`PropagateThroughPrecisionPreserved <openvino_docs_OV_UG_lpt_PropagateThroughPrecisionPreserved>`
|
||||
* :doc:`PropagateToInput <openvino_docs_OV_UG_lpt_PropagateToInput>`
|
||||
* :doc:`UpdateSharedPrecisionPreserved <openvino_docs_OV_UG_lpt_UpdateSharedPrecisionPreserved>`
|
||||
* :doc:`CreateAttribute <step2-markup/create-attribute>`
|
||||
* :doc:`CreatePrecisionsDependentAttribute <step2-markup/create-precisions-dependent-attribute>`
|
||||
* :doc:`PropagateThroughPrecisionPreserved <step2-markup/propagate-through-precision-preserved>`
|
||||
* :doc:`PropagateToInput <step2-markup/propagate-to-input>`
|
||||
* :doc:`UpdateSharedPrecisionPreserved <step2-markup/update-shared-precision-preserved>`
|
||||
|
||||
Let's explore all transformations and their relations in detail, using one and the same model:
|
||||
|
||||
.. image:: _static/images/step2_markup_original.svg
|
||||
.. image:: ../../../../../_static/images/step2_markup_original.svg
|
||||
|
||||
The original model key features:
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ Changes in the example model after ``MarkupCanBeQuantized`` transformation:
|
|||
|
||||
Result model:
|
||||
|
||||
.. image:: _static/images/step2_markup1.svg
|
||||
.. image:: ../../../../../_static/images/step2_markup1.svg
|
||||
:alt: MarkupCanBeQuantize
|
||||
|
||||
Model display features (here and below):
|
||||
|
|
@ -137,7 +137,7 @@ No attributes are required before the transformation. Changes in the example mod
|
|||
|
||||
Result model:
|
||||
|
||||
.. image:: _static/images/step2_markup2.svg
|
||||
.. image:: ../../../../../_static/images/step2_markup2.svg
|
||||
:alt: MarkupPrecisions result
|
||||
|
||||
3. MarkupPerTensorQuantization
|
||||
|
|
@ -151,7 +151,7 @@ Changes in the example model after ``MarkupPerTensorQuantization`` transformatio
|
|||
|
||||
Result model:
|
||||
|
||||
.. image:: _static/images/step2_markup3.svg
|
||||
.. image:: ../../../../../_static/images/step2_markup3.svg
|
||||
:alt: MarkupPerTensorQuantization result
|
||||
|
||||
4. MarkupAvgPoolPrecisionPreserved
|
||||
|
|
@ -169,7 +169,7 @@ Changes in the example model after ``MarkupAvgPoolPrecisionPreserved`` transform
|
|||
|
||||
Result model:
|
||||
|
||||
.. image:: _static/images/step2_markup4.svg
|
||||
.. image:: ../../../../../_static/images/step2_markup4.svg
|
||||
:alt: arkupAvgPoolPrecisionPreserved
|
||||
|
||||
5. PropagatePrecisions
|
||||
|
|
@ -188,7 +188,7 @@ Changes in the example model after ``PropagatePrecisions`` transformation:
|
|||
|
||||
Result model:
|
||||
|
||||
.. image:: _static/images/step2_markup5.svg
|
||||
.. image:: ../../../../../_static/images/step2_markup5.svg
|
||||
:alt: PropagatePrecisions
|
||||
|
||||
.. note::
|
||||
|
|
@ -208,7 +208,7 @@ Changes in the example model after ``AlignQuantizationIntervals`` transformation
|
|||
|
||||
Result model:
|
||||
|
||||
.. image:: _static/images/step2_markup6.svg
|
||||
.. image:: ../../../../../_static/images/step2_markup6.svg
|
||||
:alt: AlignQuantizationIntervals
|
||||
|
||||
7. AlignQuantizationParameters
|
||||
|
|
@ -227,6 +227,6 @@ Changes in the example model after ``AlignQuantizationParameters`` transformatio
|
|||
|
||||
Final model:
|
||||
|
||||
.. image:: _static/images/step2_markup7.svg
|
||||
.. image:: ../../../../../_static/images/step2_markup7.svg
|
||||
:alt: AlignQuantizationParameters
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_AlignQuantizationIntervals}
|
||||
.. {#../../low-precision-transformations_AlignQuantizationIntervals}
|
||||
|
||||
AlignQuantizationIntervals transformation
|
||||
=========================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_AlignQuantizationParameters}
|
||||
.. {#../../low-precision-transformations_AlignQuantizationParameters}
|
||||
|
||||
AlignQuantizationParameters transformation
|
||||
==========================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_CreateAttribute}
|
||||
.. {#../../low-precision-transformations_CreateAttribute}
|
||||
|
||||
CreateAttribute transformation
|
||||
==============================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_CreatePrecisionsDependentAttribute}
|
||||
.. {#../../low-precision-transformations_CreatePrecisionsDependentAttribute}
|
||||
|
||||
CreatePrecisionsDependentAttribute transformation
|
||||
=================================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_MarkupAvgPoolPrecisionPreserved}
|
||||
.. {#../../low-precision-transformations_MarkupAvgPoolPrecisionPreserved}
|
||||
|
||||
MarkupAvgPoolPrecisionPreserved transformation
|
||||
==============================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_MarkupBias}
|
||||
.. {#../../low-precision-transformations_MarkupBias}
|
||||
|
||||
MarkupBias transformation
|
||||
=========================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_MarkupCanBeQuantized}
|
||||
.. {#../../low-precision-transformations_MarkupCanBeQuantized}
|
||||
|
||||
MarkupCanBeQuantized transformation
|
||||
===================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_MarkupPerTensorQuantization}
|
||||
.. {#../../low-precision-transformations_MarkupPerTensorQuantization}
|
||||
|
||||
MarkupPerTensorQuantization transformation
|
||||
==========================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_MarkupPrecisions}
|
||||
.. {#../../low-precision-transformations_MarkupPrecisions}
|
||||
|
||||
MarkupPrecisions transformation
|
||||
===============================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_PropagatePrecisions}
|
||||
.. {#../../low-precision-transformations_PropagatePrecisions}
|
||||
|
||||
PropagatePrecisions transformation
|
||||
==================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_PropagateSharedValue}
|
||||
.. {#../../low-precision-transformations_PropagateSharedValue}
|
||||
|
||||
PropagateSharedValue transformation
|
||||
===================================
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.. {#openvino_docs_OV_UG_lpt_PropagateThroughPrecisionPreserved}
|
||||
.. {#../../low-precision-transformations_PropagateThroughPrecisionPreserved}
|
||||
|
||||
PropagateThroughPrecisionPreserved transformation
|
||||
=================================================
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue