본문 바로가기
Deep Learning/OpenVINO

OpenVINO - intel의 강력한 딥러닝 툴킷!

by Natekwon 2021. 3. 20.

OpenVINO란?

인텔에서 제공하는 딥러닝 최적화 및 하드웨어 가속화기능을 가진 툴킷이다.

쉽게 말하면 인텔의 CPU를 딥러닝의 작동에 최적의 성능을 내도록 작동시킨다.

 

단적인 예로, 최근에 YOLO V4 tiny 모델을 학습시키고 Edge 단에서 실행을 시켜야할 일이 있었다. intel의 cpu와 그래픽 카드가 적용된 Asus의 PN60 미니 PC에서 작동을 시켜야 했다. 당연히 작동하기 위해서는 google의 coral tpu와 intel의 NCS2와 같은 딥러닝 가속기가 필요할 줄 알았다.

 

결론부터 얘기하자면 OpenVINO를 사용하여 미니 PC의 CPU를 쓰는게 가장 속도가 빨랐다. 다른 프로그램을 쓰지 않고, CPU를 사용하면 30~35FPS의 빠른속도로 작동했고, 다른 프로그램과 같이써도 13~15FPS정도 속도가 나왔다. 반면 intel의 NCS2 스틱만을 사용했을때는 7~8FPS로 다소 느렸다. google의 tpu는 YOLO V4 tiny에 적용된 Leaky ReLu 활성화 함수를 적용할 수 없었고, 그냥 ReLu로 변환하여 학습하였을때, 성능이 좋지 않아서 적용을 포기했다.

 

자 그럼, OpenVINO를 어떻게 사용할까?

 

software.intel.com/content/www/us/en/develop/tools/openvino-toolkit/download.html

 

Download Intel® Distribution of OpenVINO™ Toolkit

Download a version of the Intel® Distribution of OpenVINO™ toolkit for Linux, Windows, or macOS.

software.intel.com

먼저 위의 싸이트에서 OpenVINO 2020R4 버전을 다운 받는다. 2020년 4번째 버전인데, 지금 가장 안정적이다. 

 

그리고 

docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux.html

 

Install Intel® Distribution of OpenVINO™ toolkit for Linux* - OpenVINO™ Toolkit

NOTES: These steps apply to Ubuntu*, CentOS*, and Yocto*. If you are using Intel® Distribution of OpenVINO™ toolkit on Windows* OS, see the Installation Guide for Windows*. CentOS and Yocto installations will require some modifications that are not cove

docs.openvinotoolkit.org

인스톨 가이드를 따라서 설치한다.

나는 우분투 18.04LTS 버전에서 진행했다.

 

source /opt/intel/openvino/bin/setupvars.sh

다음과 같은 명령어로 openvino기반으로 실행되도록 설정한다.

그리고 openvino에서 사용가능하도록 딥러닝 모델을 .xml과 .bin파일로 변환하여 openvino cpu를 활용하여 실행하면 된다.