* Mark as deprecated nGraph API * Fixed code style * Added IN_OV_LIBRARY define * Suppress warnings for log * Suppress warning * Updated nGraph headers * Fixed build for macOS * Fixed lpt and snippets * Fixed build all on macOS * Suppress some warnings * Fixed some new warnings * Fixed new warnings * Try to fix some warnings * More warnings * Soome change * Suppress more warnings * Suppress warnings for transformations * Suppress warnings for LPT * One more fix * Suppress more warnings * Try to fix opset error * Remove opset constructor * Cannot fix opset warning * Suppress warnings for offline transfromations * Fixed some warnings for Windows * Fixed code style * Suppress some warnings for onnx FE * Revert "Suppress some warnings for onnx FE" This reverts commit75d23b64fc. * Revert "Fixed code style" This reverts commitc6eba63116. * Revert "Fixed some warnings for Windows" This reverts commit23d7ed88b6. * Revert "Suppress warnings for offline transfromations" This reverts commit0b9f6317bf. * Revert "Cannot fix opset warning" This reverts commit19ea658639. * Revert "Remove opset constructor" This reverts commit06afb1bc20. * Revert "Suppress warnings for LPT" This reverts commit58b1c0f5a0. * Revert "Suppress warnings for transformations" This reverts commitf8bb9814a1. * Revert "Suppress more warnings" This reverts commitf9f0da9acb. * Revert "Soome change" This reverts commite545d4984e. * Remove deprecation for ngraph::OpSet and FactoryRegistry
Installation
Installing from PyPi
- Create a virtual environment and activate it, e.g.:
virtualenv -p /usr/bin/python3.7 .env3
source .env3/bin/activate
- Install openvino-dev package, it contains model conversion API:
pip install openvino-dev
This will download all requirements and will install MO in your current virtual environment. If you need only particular frameworks you can specify them manually as optional dependencies in square brackets. E.g. the command below will install dependencies to support ONNX* and TensorFlow2* models:
pip install openvino-dev[onnx,tensorflow2]
To enable support of MxNet* models run:
pip install openvino-dev[mxnet]
To enable support of all frameworks:
pip install openvino-dev[all]
By default, if no frameworks are specified, dependencies to support ONNX* and TensorFlow2* are installed.
Converting models
Setup development environment
If you want to contribute to model conversion API you will need to deploy developer environment. You can do that by following the steps below:
- Create virtual environment and activate it, e.g.:
virtualenv -p /usr/bin/python3.7 .env3
source .env3/bin/activate
- Clone the OpenVINO™ repository and change dir to model-optimizer
git clone https://github.com/openvinotoolkit/openvino
cd openvino/tools/mo/
- Install openvino-mo package for development:
pip install -e .
or run setup.py develop, result will be the same:
python setup.py develop
This will download all requirements and deploy model conversion API for development in your virtual environment: specifically will create *.egg-link into the current directory in your site-packages. As previously noted, you can also manually specify to support only selected frameworks :
pip install -e ".[onnx,tensorflow2]"
How to run unit-tests
- Run tests with:
python -m unittest discover -p "*_test.py" [-s PATH_TO_DIR]
How to capture unit-tests coverage
- Run tests with:
coverage run -m unittest discover -p "*_test.py" [-s PATH_TO_DIR]
- Build html report:
coverage html
How to run code linting
- Run the following command:
pylint openvino/tools/mo/ mo.py