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安装教程
-
媒体: