Steps to install OpenVINO™ Training Extension from GitHub repository "misc" branch.
Unable to install OpenVINO™ Training Extension from GitHub* repository misc branch.
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:
- Download OpenVINO Toolkit 2021.4.2 for Linux* OS.
- Follow Install and Configure Intel® Distribution of OpenVINO™ toolkit for Linux*.
- Clone OpenVINO™ Training Extensions repository:
git clone https://github.com/openvinotoolkit/training_extensions.git
export OTE_DIR=`pwd`/training_extensions
- 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
- Change directory to object_detection:
cd /training_extensions/models/object_detection
- Create virtual environment:
./init_venv.sh
- Activate virtual environment:
source venv/bin/activate
- 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
- 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 .
- 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}
- 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
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