authored-by: Tatiana Savina <tatiana.savina@intel.com>
This commit is contained in:
parent
e961ce307b
commit
933d9c1c0a
|
|
@ -221,7 +221,7 @@ The figure below illustrates the typical workflow for deploying a trained deep-l
|
|||
Convert a Model in CLI: ``ovc``
|
||||
###############################
|
||||
|
||||
Another option for model conversion is to use ``ovc`` command-line tool, which stands for OpenVINO Model Converter. The tool combines both ``openvino.convert_model`` and ``openvino.save_model`` functionalities. It is convenient to use when the original model is ready for inference and is in one of the supported file formats: ONNX, TensorFlow, TensorFlow Lite, or PaddlePaddle. As a result, ``ovc`` produces an OpenVINO IR, consisting of ``.xml`` and ``.bin`` files, which needs to be read with the ``ov.read_model()`` method. You can compile and infer the ``ov.Model`` later with :doc:`OpenVINO™ Runtime <openvino_docs_OV_UG_OV_Runtime_User_Guide>`
|
||||
Another option for model conversion is to use ``ovc`` command-line tool, which stands for OpenVINO Model Converter. The tool combines both ``openvino.convert_model`` and ``openvino.save_model`` functionalities. It is convenient to use when the original model is ready for inference and is in one of the supported file formats: ONNX, TensorFlow, TensorFlow Lite, or PaddlePaddle. As a result, ``ovc`` produces an OpenVINO IR, consisting of ``.xml`` and ``.bin`` files, which needs to be read with the ``openvino.Core.read_model`` method. You can compile and infer the ``ov.Model`` later with :doc:`OpenVINO™ Runtime <openvino_docs_OV_UG_OV_Runtime_User_Guide>`
|
||||
|
||||
.. note::
|
||||
PyTorch models cannot be converted with ``ovc``, use ``openvino.convert_model`` instead.
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ Some PaddlePaddle models may require setting ``example_input`` or ``output`` for
|
|||
|
||||
* Example of converting ``paddle.fluid.dygraph.layers.Layer`` format model:
|
||||
|
||||
``example_input`` is required while ``output`` is optional, which accept the following formats:
|
||||
``example_input`` is required while ``output`` is optional. ``example_input`` accepts the following formats:
|
||||
|
||||
``list`` with tensor (``paddle.Tensor``) or InputSpec (``paddle.static.input.InputSpec``)
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ The value for the ``example_input`` parameter can be easily derived from knowing
|
|||
import torch
|
||||
import openvino as ov
|
||||
|
||||
model = torchvision.models.resnet50(pretrained=True)
|
||||
ov_model = ov.convert_model(model, example_input=example_input=torch.rand(1, 3, 224, 224))
|
||||
model = torchvision.models.resnet50(weights='DEFAULT')
|
||||
ov_model = ov.convert_model(model, example_input=torch.rand(1, 3, 224, 224))
|
||||
|
||||
In practice, the code to evaluate or test the PyTorch model is usually provided with the model itself and can be used to generate a proper ``example_input`` value. A modified example of using ``resnet50`` model from ``torchvision`` is presented below. It demonstrates how to switch inference in the existing PyTorch application to OpenVINO and how to get value for ``example_input``:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue