Article ID: 000095900 Content Type: Install & Setup Last Reviewed: 09/05/2023

How to Install OpenVINO™ Training Extension from GitHub Repository “Misc” Branch?

Environment

Ubuntu 18.04

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Steps to install OpenVINO™ Training Extension from GitHub repository "misc" branch.

Description

Unable to install OpenVINO™ Training Extension from GitHub* repository misc branch.

Resolution

Prerequisites

  • Ubuntu* 18.04 / 20.04
  • Python* 3.6+
  • OpenVINO™ - for exporting and running models
  • CUDA Toolkit 10.2 - for training on GPU

 

Installation Steps:

  1. Download OpenVINO Toolkit 2021.4.2 for Linux* OS.
  2. Follow Install and Configure Intel® Distribution of OpenVINO™ toolkit for Linux*.
  3. Clone OpenVINO™ Training Extensions repository:

    git clone https://github.com/openvinotoolkit/training_extensions.git

    export OTE_DIR=`pwd`/training_extensions

  4. Clone Open Model Zoo repository to run demos:

    git clone https://github.com/openvinotoolkit/open_model_zoo --branch 2021.4.2

    export OMZ_DIR=`pwd`/open_model_zoo

  5. Change directory to object_detection:

    cd /training_extensions/models/object_detection

  6. Create virtual environment:

    ./init_venv.sh

  7. Activate virtual environment:

    source venv/bin/activate

  8. Modify the onnxoptimizer and onnx versions in the following runtime.txt file:

    /training_extensions/external/mmdetection/requirements/runtime.txt

    onnx==1.10.1

    onnxoptimizer==0.2.6

  9. Install MMDetection inside the virtual environment:

    cd /training_extensions/external/mmdetection/

    pip install -r requirements/build.txt

    pip install "git+ https://github.com/open-mmlab/cocoapi.git#subdirectory=pycocotools"

    pip install -v -e .

  10. Continue Step 2 in Horizontal Text Detection guide.

    cd /training_extensions/models/object_detection

    export MODEL_TEMPLATE=`realpath ./model_templates/horizontal-text-detection/horizontal-text-detection-0001/template.yaml`

    export WORK_DIR=/tmp/my-$(basename $(dirname $MODEL_TEMPLATE))

    export SNAPSHOT=snapshot.pth

    python ../../tools/instantiate_template.py ${MODEL_TEMPLATE} ${WORK_DIR}

  11. Continue Step 3. Try a pre-trained model

    cd ${WORK_DIR}

    python export.py \

    --load-weights ${SNAPSHOT} \

    --save-model-to export

    python ${OMZ_DIR}/demos/object_detection_demo/python/object_detection_demo.py \

    -m export/model.xml \

    -at ssd \

    -i /dev/video0

Additional information

Troubleshooting steps:

If ModuleNotFoundError: No module named 'mmcv._ext' occurred, downgrade CUDA to version 10.2.

 

If RuntimeError: OpenVINO™ Model Optimizer is not found or configured properly occurred, complete the steps in Step 4: Configure the Model Optimizer.

If the error persists, provide the full PATH for mo.py inside of the /mmdetection/tools/export.py file (Line 154,171,179 and 185).

FULL PATH for mo.py:

/opt/intel/openvino_2021.4.752/deployment_tools/model_optimizer/mo.py

Related Products

This article applies to 1 products