[DOCS] Moved Troubleshooting Reshape article to legacy section. (#21819)

* Moved Troubleshooting Reshape article to legacy section.

* Minor correction.

* Link corrected.

* Removed not working link.
This commit is contained in:
Anastasiia Pnevskaia 2023-12-22 09:52:12 +01:00 committed by GitHub
parent 2fcaa88af5
commit cc22a93395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 17 deletions

View File

@ -9,6 +9,7 @@ Legacy Conversion API
: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>

View File

@ -1,7 +1,7 @@
.. {#troubleshooting_reshape_errors}
Troubleshooting Reshape Errors
==============================
[LEGACY] Troubleshooting Reshape Errors
=======================================
.. meta::
@ -10,6 +10,10 @@ Troubleshooting Reshape Errors
normal shape propagation.
.. 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.
How To Avoid Shape Collision
############################
@ -24,7 +28,7 @@ Model structure and logic should not change significantly after model reshaping.
* The Global Pooling operation is commonly used to reduce output feature map of classification models output. Having the input of the shape *[N, C, H, W]*, Global Pooling returns the output of the shape *[N, C, 1, 1]*. Model architects usually express Global Pooling with the help of the ``Pooling`` operation with the fixed kernel size *[H, W]*. During spatial reshape, having the input of the shape *[N, C, H1, W1]*, ``Pooling`` with the fixed kernel size *[H, W]* returns the output of the shape *[N, C, H2, W2]*, where *H2* and *W2* are commonly not equal to *1*. It breaks the classification model structure. For example, the public `Inception family models from TensorFlow <https://github.com/tensorflow/models/tree/master/research/slim#pre-trained-models>`__ have this issue.
* Changing the model input shape may significantly affect its accuracy. For example, Object Detection models from TensorFlow have resizing restrictions by design. To keep the model valid after the reshape, choose a new input shape that satisfies conditions listed in the ``pipeline.config`` file. For details, refer to the :ref:`Tensorflow Object Detection API models resizing techniques <custom-input-shape>`.
* Changing the model input shape may significantly affect its accuracy. For example, Object Detection models from TensorFlow have resizing restrictions by design. To keep the model valid after the reshape, choose a new input shape that satisfies conditions listed in the ``pipeline.config`` file.
.. _how-to-fix-non-reshape-able-model:

View File

@ -136,6 +136,4 @@ For example, launch model conversion for the ONNX OCR model and specify a bounda
ovc ocr.onnx --input data[1..3,150,200,1],seq_len[1..3]
In practice, not every model is designed in a way that allows change of input shapes. An attempt to change the shape for such models may lead to an exception during model conversion, later in model inference, or even to wrong results of inference without explicit exception raised. A knowledge about model topology is required to set shapes appropriately.
For more information about shape follow the :doc:`inference troubleshooting <troubleshooting_reshape_errors>`
and :ref:`ways to relax shape inference flow <how-to-fix-non-reshape-able-model>` guides.

View File

@ -3,13 +3,6 @@
Changing Input Shapes
=====================
.. toctree::
:maxdepth: 1
:hidden:
troubleshooting_reshape_errors
.. meta::
:description: OpenVINO™ allows changing model input shape during the runtime when the provided
input has a different size than the model's input shape.
@ -22,8 +15,8 @@ The following instructions are for cases where you need to change the model inpu
.. note::
If you need to do this only once, prepare a model with updated shapes via
:doc:`model conversion API <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>`.
For more information, refer to the :ref:`Specifying input_shape Parameter <when_to_specify_input_shapes>` article.
:doc:`Model Conversion API <openvino_docs_model_processing_introduction>`.
For more information, refer to the :doc:`Setting Input Shapes <openvino_docs_OV_Converter_UG_prepare_model_convert_model_Converting_Model>` article.
The reshape method
@ -165,7 +158,7 @@ You can find the usage scenarios of the ``reshape`` method in
.. note::
In some cases, models may not be ready to be reshaped. Therefore, a new input
shape cannot be set neither with :doc:`Model Optimizer <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>`
shape cannot be set neither with :doc:`Model Conversion API <openvino_docs_model_processing_introduction>`
nor the ``reshape`` method.
The set_batch method
@ -192,8 +185,7 @@ To change the batch dimension of the model, :ref:`set the layout <declare_model_
The ``set_batch`` method is a high-level API of the reshape functionality, so all
information about the ``reshape`` method implications are applicable for ``set_batch``
too, including the troubleshooting section.
information about the ``reshape`` method implications are applicable for ``set_batch`` too.
Once you set the input shape of the model, call the ``compile_model`` method to
get a ``CompiledModel`` object for inference with updated shapes.