1、clone openvino
git clone --recursive https://gitee.com/openvinotoolkit-prc/openvino.git
若在 clone 一些三方依赖外链时超时,可单独转 gitee 进行 clone 。
2、编译
安装依赖:
chmod +x install_build_dependencies.sh
./install_build_dependencies.sh
编译
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CLDNN=OFF ..
make -j16
make install -j16
3、安装 python 接口
cd src/bindings/python/src/compatibility/openvino
pip install -i https://pypi.douban.com/simple -r requirements-dev.txt
然后回到第2步,添加编译选项 -DENABLE_PYTHON=ON
,进行重新编译。若要指定具体的 python 版本:
-DPYTHON_EXECUTABLE=`which python3.7` \
-DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.7m.so \
-DPYTHON_INCLUDE_DIR=/usr/include/python3.7
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CLDNN=OFF -DENABLE_PYTHON=ON -DPython3_EXECUTABLE=/home/codingai/anaconda3/envs/baozi_py39/bin/python ..
make -j16
make install -j16
编译完进行验证:
python
>>> import openvino
以上无报错说明成功安装 openvino python 接口。
4、clone open_model_zoo
git clone --recursive https://github.com/openvinotoolkit/open_model_zoo.git
5、测试
cd openvino/scripts/demo
./demo_squeezenet_download_convert_run.sh
中间会出现一些路径的报错,因为我这里没有按照 openvino 官网教程来配置 open_model_zoo,按你的 open_model_zoo 路径改一下就好了。
成功输出会是这样。