* Release mo dev guide refactoring (#3266) * Updated MO extension guide * Minor change and adding svg images * Added additional information about operation extractors. Fixed links and markdown issues * Added missing file with information about Caffe Python layers and image for MO transformations dependencies graph * Added section with common graph transformations attributes and diagram with anchor transformations. Added list of available front phase transformations * Added description of front-phase transformations except the scope-defined and points defined. Removed legacy document and examples for such transformations. * Added sections about node name pattern defined front phase transformations. Copy-pasted the old one for the points defined front transformation * Added description of the rest of front transformations and and all middle and back phase transformations * Refactored Legacy_Mode_for_Caffe_Custom_Layers and updated the Customize_Model_Optimizer with information about extractors order * Added TOC for the MO Dev guide document and updated SVG images with PNG ones * Fixed broken link. Removed redundant image * Fixed broken links * Added information about attributes 'run_not_recursively', 'force_clean_up' and 'force_shape_inference' of the transformation * Code review comments * Added a section about `Port`s * Extended Ports description with examples * Added information about Connections * Updated MO README.md and removed a lot of redundant and misleading information * Updates to the Customize_Model_Optimizer.md * More updates to the Customize_Model_Optimizer.md * Final updates for the Customize_Model_Optimizer.md * Fixed some broken links * More fixed links * Refactored Custom Layers Guide: removed legacy and incorrect text, added up-to-date. * Draft implementation of the Custom layer guide example for the MO part * Fixed broken links using #. Change layer->operation in extensibility documents * Updated Custom operation guide with IE part * Fixed broken links and minor updates to the Custom Operations Guide * Updating links * Layer->Operation * Moved FFTOp implementation to the template extension * Update the CMake for template_extension to build the FFT op conditionally * Fixed template extension compilation * Fixed CMake for template extension * Fixed broken snippet * Added mri_demo script and updated documentation * One more compilation error fix * Added missing header for a demo file * Added reference to OpenCV * Fixed unit test for the template extension * Fixed typos in the template extension * Fixed compilation of template extension for case when ONNX importer is disabled Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
8.4 KiB
Model Optimizer Developer Guide
Model Optimizer is a cross-platform command-line tool that facilitates the transition between the training and deployment environment, performs static model analysis, and adjusts deep learning models for optimal execution on end-point target devices.
Model Optimizer process assumes you have a network model trained using a supported deep learning framework. The scheme below illustrates the typical workflow for deploying a trained deep learning model:
Model Optimizer produces an Intermediate Representation (IR) of the network, which can be read, loaded, and inferred with the Inference Engine. The Inference Engine API offers a unified API across a number of supported Intel® platforms. The Intermediate Representation is a pair of files describing the model:
-
.xml- Describes the network topology -
.bin- Contains the weights and biases binary data.
What's New in the Model Optimizer in this Release?
- Common changes:
- Implemented several optimization transformations to replace sub-graphs of operations with HSwish, Mish, Swish and SoftPlus operations.
- Model Optimizer generates IR keeping shape-calculating sub-graphs by default. Previously, this behavior was triggered if the "--keep_shape_ops" command line parameter was provided. The key is ignored in this release and will be deleted in the next release. To trigger the legacy behavior to generate an IR for a fixed input shape (folding ShapeOf operations and shape-calculating sub-graphs to Constant), use the "--static_shape" command line parameter. Changing model input shape using the Inference Engine API in runtime may fail for such an IR.
- Fixed Model Optimizer conversion issues resulted in non-reshapeable IR using the Inference Engine reshape API.
- Enabled transformations to fix non-reshapeable patterns in the original networks:
- Hardcoded Reshape
- In Reshape(2D)->MatMul pattern
- Reshape->Transpose->Reshape when the pattern can be fused to the ShuffleChannels or DepthToSpace operation
- Hardcoded Interpolate
- In Interpolate->Concat pattern
- Added a dedicated requirements file for TensorFlow 2.X as well as the dedicated install prerequisites scripts.
- Replaced the SparseToDense operation with ScatterNDUpdate-4.
- Hardcoded Reshape
- ONNX*:
- Enabled an ability to specify the model output tensor name using the "--output" command line parameter.
- Added support for the following operations:
- Acosh
- Asinh
- Atanh
- DepthToSpace-11, 13
- DequantizeLinear-10 (zero_point must be constant)
- HardSigmoid-1,6
- QuantizeLinear-10 (zero_point must be constant)
- ReduceL1-11, 13
- ReduceL2-11, 13
- Resize-11, 13 (except mode="nearest" with 5D+ input, mode="tf_crop_and_resize", and attributes exclude_outside and extrapolation_value with non-zero values)
- ScatterND-11, 13
- SpaceToDepth-11, 13
- TensorFlow*:
- Added support for the following operations:
- Acosh
- Asinh
- Atanh
- CTCLoss
- EuclideanNorm
- ExtractImagePatches
- FloorDiv
- Added support for the following operations:
- MXNet*:
- Added support for the following operations:
- Acosh
- Asinh
- Atanh
- Added support for the following operations:
- Kaldi*:
- Fixed bug with ParallelComponent support. Now it is fully supported with no restrictions.
NOTE: Intel® System Studio is an all-in-one, cross-platform tool suite, purpose-built to simplify system bring-up and improve system and IoT device application performance on Intel® platforms. If you are using the Intel® Distribution of OpenVINO™ with Intel® System Studio, go to Get Started with Intel® System Studio.
Table of Content
-
Preparing and Optimizing your Trained Model with Model Optimizer
- Configuring Model Optimizer
- Converting a Model to Intermediate Representation (IR)
- Converting a Model Using General Conversion Parameters
- Converting Your Caffe* Model
- Converting Your TensorFlow* Model
- Converting BERT from TensorFlow
- Converting GNMT from TensorFlow
- Converting YOLO from DarkNet to TensorFlow and then to IR
- Converting Wide and Deep Models from TensorFlow
- Converting FaceNet from TensorFlow
- Converting DeepSpeech from TensorFlow
- Converting Language Model on One Billion Word Benchmark from TensorFlow
- Converting Neural Collaborative Filtering Model from TensorFlow*
- Converting TensorFlow* Object Detection API Models
- Converting TensorFlow*-Slim Image Classification Model Library Models
- Converting CRNN Model from TensorFlow*
- Converting Your MXNet* Model
- Converting Your Kaldi* Model
- Converting Your ONNX* Model
- Model Optimizations Techniques
- Cutting parts of the model
- Sub-graph Replacement in Model Optimizer
- Supported Framework Layers
- Intermediate Representation and Operation Sets
- Operations Specification
- Intermediate Representation suitable for INT8 inference
- Model Optimizer Extensibility
- Model Optimizer Frequently Asked Questions
Typical Next Step: Preparing and Optimizing your Trained Model with Model Optimizer
