下载安装包
到下面的网址去下载或者用自己之前下载的安装包:
intel官网openvino下载地址
安装openvino
cd到压缩包的地址,解压:
tar -xvzf l_openvino_toolkit_p_<version>.tgz
打开解压文件运行图形化安装界面:
cd l_openvino_toolkit_p_<version>
GUI Installation Wizard: sudo ./install_GUI.sh
然后疯狂点下一步运行完这个安装程序,如果按照默认openvino会安装在/opt/intel,运行下面命令下载依赖:
cd /opt/intel/openvino_2021/install_dependencies/
sudo -E ./install_openvino_dependencies.sh
添加环境变量
sudo gedit ~/.bashrc
在最后添加
source /opt/intel/openvino_2021/bin/setupvars.sh
关掉文本编辑器,重新打开一个终端,可以看到
[setupvars.sh] OpenVINO environment initialized
说明安装成功
检查CPU环境是否配置无误的方法是运行
/opt/intel/openvino/deployment_tools/demo中的
./demo_security_barrier_camera.sh
若成功运行则cpu环境正常
./demo_security_barrier_camera.sh -d GPU
运行成功则GPU环境正常
我在配NUC的时候GPU没成功,后来发现是没配置GPU环境,在文章下面
[ ERROR ] Failed to create plugin /opt/intel/openvino_2021/deployment_tools
/inference_engine/lib/intel64/libclDNNPlugin.so for device GPU
Please, check your environment
Cannot load library '/opt/intel/openvino_2021/deployment_tools/inference_engine
/lib/intel64/libclDNNPlugin.so': libOpenCL.so.1: cannot open shared object file: No such file
or directory
手敲C++神经网络
初始化一个神经网络:
Core ie
auto cnnNetwork = ie.ReadNetwork(mmm_xml_detect) // 初始化一个神经网络,mmm_xml_detect是权重路径
配置GPU环境
cd /opt/intel/openvino/install_dependencies
sudo -E su
./install_NEO_OCL_driver.sh
sudo usermod -a -G video,render hitcrt
运行./install_NEO_OCL_driver.sh经常因为网速太慢不成功,可以把github链接换成国内镜像,如:
curl -L -O https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-gmmlib_19.3.2_amd64.deb
换成:
curl -L -O https://ghproxy.com/https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-gmmlib_19.3.2_amd64.deb
建议用gedit打开批量替换,网速大大提高,配置成功。