天天看点

【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo

接上篇【OpenVINO】Win 10安装配置OpenVINO指南。

一、Intel集成显卡

使用Intel集成显卡,确保驱动已经正常安装,并且驱动版本高于15.65。

打开设备管理器,

【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo

右键选择属性,

【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo

点击驱动程序选项卡,

【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo

查看驱动程序版本是否符合要求。

二、Intel® Neural Compute Stick 2

Intel® Neural Compute Stick 2由 Intel® Movidius™ Myriad™ X VPU提供技术支持。

进入目录

C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\inference_engine\external\MovidiusDriver
           

右键选择Movidius_VSC_Device.inf,选择安装

【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo

确保cmake和python加入了环境变量。

三、运行图像分类demo

如果需要在VPU设备上运行,则需要将FP32类型的model转化为FP16类型。

为了统一,首先新建一个和FP32同样结构的目录

C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP16\classification\squeezenet\1.1\caffe
           

打开cmd,执行命令

python3 "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo.py" --input_model "C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP32\classification\squeezenet\1.1\caffe\squeezenet1.1.caffemodel" --data_type FP16 --output_dir "C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP16\classification\squeezenet\1.1\caffe"
           

然后将"C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\ir\FP32\classification\squeezenet\1.1\caffe\squeezenet1.1.labels"拷贝到"C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP16\classification\squeezenet\1.1\caffe"下。

下面可以运行demo了。

打开cmd,进入目录

cd C:\Users\hh\Documents\Intel\OpenVINO\inference_engine_samples_build\intel64\Release
           

CPU:

classification_sample.exe -i "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\demo\car.png" -m "C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP16\classification\squeezenet\1.1\caffe\squeezenet1.1.xml" -d CPU
           
【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo

我的CPU不支持FP16类型。

换成FP32类型的model。

classification_sample.exe -i "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\demo\car.png" -m "C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP32\classification\squeezenet\1.1\caffe\squeezenet1.1.xml" -d CPU
           
【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo

GPU:

classification_sample.exe -i "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\demo\car.png" -m "C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP16\classification\squeezenet\1.1\caffe\squeezenet1.1.xml" -d GPU
           
【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo
classification_sample.exe -i "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\demo\car.png" -m "C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP32\classification\squeezenet\1.1\caffe\squeezenet1.1.xml" -d GPU
           
【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo

VPU( Intel® Neural Compute Stick 2):

classification_sample.exe -i "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\demo\car.png" -m "C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP16\classification\squeezenet\1.1\caffe\squeezenet1.1.xml" -d MYRIAD
           
【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo
classification_sample.exe -i "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\demo\car.png" -m "C:\Users\hh\Documents\Intel\OpenVINO\openvino_models\models\FP32\classification\squeezenet\1.1\caffe\squeezenet1.1.xml" -d MYRIAD
           
【OpenVINO】在GPU和Intel® Neural Compute Stick 2进行推理的配置一、Intel集成显卡二、Intel® Neural Compute Stick 2三、运行图像分类demo

不支持FP32类型的model。

继续阅读