1. Profile
overview
(本節內容引自 Intel NCS2計算棒以及OpenVINO嚐鮮)
計算棒需要配合Intel出的OpenVINO推理框架,使用時首先需要將模型文件轉換爲OpenVINO的模型。OpenVINO目前支持Caffe、TensorFlow、MXNet等主流的深度學習框架。模型可以直接通過OpenVINO的轉換工具進行轉換。轉換時需要輸入網絡輸入節點的名稱以及輸入圖片的大小,還有一點需要注意,NCS 2計算棒支持的是16位精度的浮點型數據,所以在轉換時還需要加上”–data_type=FP16”。
OpenVINO框架中使用NCS 2計算棒和直接使用CPU性能差不多,使用CPU(Intel Core i5 4200M)時,檢測一幀需要660ms,使用NCS2計算棒需要590ms。但是在OpenVINO框架中使用CPU速度要比在MXNet中使用CPU快,MXNet中使用CPU檢測一幀需要1.1s左右。OpenVINO前向計算能基本比mxnet框架快一倍。
2. Installation
2.1 Linux
python3
cd Python-3.5.6;
./configure --enable-shared;
make all -j16;
make install;
echo "/usr/local/lib" > /etc/ld.so.conf.d/python3.conf;ldconfig;
vim /usr/bin/yum
#!/usr/bin/python ->#!/usr/bin/python2
rm /usr/bin/python;ln -s /usr/local/bin/python3 /usr/bin/python3;
ln -s /usr/local/bin/python3.5 /usr/bin/python3.5;
ln -s /usr/local/bin/pip3 /usr/bin/pip
yum -y install cmake
cmake --version
cmake version 2.8.12.2
2.1.1 Install Basic Openvino
- 下載並解壓 Intel® Distribution of OpenVINO™ toolkit for Linux*
tar -xvzf l_openvino_toolkit_p_<version>.tgz cd l_openvino_toolkit_p_<version>
- 命令行安裝
yum install pciutils; yum install redhat-lsb -y; sudo ./install_openvino_dependencies.sh sudo ./install.sh
- 安裝路徑:
/opt/intel/openvino/
2.1.2 Install External Software Dependencies
cd /opt/intel/openvino/install_dependencies
sudo -E ./install_openvino_dependencies.sh
2.1.3 Set the Environment Variables
source /opt/intel/openvino/bin/setupvars.sh
echo source /opt/intel/openvino/bin/setupvars.sh >> ~/.bash_profile
或者全局生效:
echo source /opt/intel/openvino/bin/setupvars.sh >> /etc/profile && source /etc/profile
2.1.4 Configure the Model Optimizer
devnet無法訪問外網,這一步裝不了,不過應該不映像模型轉換
cd /opt/intel/openvino/deployment_tools/model_optimizer/install_prerequisites
sudo ./install_prerequisites.sh
2.1.5 Run the Verification Scripts to Verify Installation
devnet無法訪問外網,之一步無法進行,提示“沒有可用軟件包 epel-release”。只要第5章的“Run your demo”可以成功即可。
cd /opt/intel/openvino/deployment_tools/demo
./demo_squeezenet_download_convert_run.sh
2.2 Mac OS
請參考Install Intel® Distribution of OpenVINO™ toolkit for macOS* 官方macOS指南
2.3 FAQ
- lspci: command not found: yum install pciutils
- lsb_release: 未找到命令: yum install redhat-lsb -y
3. Model Optimizer
caffe模型轉換:
python3 /opt/intel/openvino/deployment_tools/model_optimizer/mo.py --input_model xxxx.caffemodel
更多請參考第六章的“模型”部分。
4. Inference Engine
4.1 Inference Engine Developer Guide
參考官方教程Inference Engine Developer Guide
4.2 Validation Application
5. Run your demo
cd /opt/intel/openvino/inference_engine/samples
./build_samples.sh
- find
inference_engine_samples_build
result in the last directory.
更多信息,請參考我的github工程:https://github.com/KindleHe/openvino_totorial
6. Issues
- The plugin does not support models of FP16 data type
- please reference to Error loading model into plugin, Supported Devices
7. References
-
- 基本指南
- 模型
- Pretrained Models:官方預訓練模型
- OpenVINO™ Toolkit - Open Model Zoo repository:官方git版本model zoo
- Converting a TensorFlow* Model:tensorflow模型轉換,支持的tensorflow算子列表
- Converting a Caffe* Model:caffe模型轉換
- Custom Layers in the Model Optimizer:定製新的層
- demo教程
- Inference Engine Samples:Intel® Distribution of OpenVINO™ Toolkit Documentation例子文檔
- Model Optimizer Developer Guide
- Inference Engine Developer Guide
- Converting a TensorFlow* Model:支持的tensorflow算子列表
- Inference Tutorials for Face Detection and Car Detection Exercises
- ros_openvino_toolkit
-
博客:
- Intel NCS2計算棒以及OpenVINO嚐鮮:介紹NCS2和OpenVINO的基本概念
- Intel OpenVINO配置和使用:介紹Intel® Core™ i7-4790K CPU @ 4.00GHz 操作系統 Ubuntu 18.04環境下如何用docker的方式部署,並跑caffe和tensorflow的demo
- 英特爾OpenVINO深度學習框架–ubuntu16.04上的安裝手記:介紹英特爾OpenVINO深度學習框架本身,包括:安裝model-optimizer、安裝inference-engine、安裝model_zoo
- 將TBB編譯到OpenVINO的Samples中
- ROS yolo加速 ros_openvino_toolkit安裝教程
-
媒體: