Как настроить OPENVINO в Ubuntu 20.04 для использования Intel movidius NCS?

Установка набора инструментов Intel OPENVINO не поддерживается в Ubuntu 20.04. Я попробовал инструментарий 2020.3.194

0
задан 11 July 2020 в 07:40

2 ответа

Так как я не могу прокомментировать ответ Лиу Г. Чако:

На шаге cmake я получил следующую ошибку:

CMake Error at inference-engine/cmake/dependencies.cmake:240 (message):
      OpenCV is not available on current platform
Call Stack (most recent call first):
      inference-engine/CMakeLists.txt:18 (include)

Был установлен OpenCV, поэтому изменилась строка 240 в ../ inference- engine / cmake / dependencies.cmake «исправил» это:

else()
-  message(FATAL_ERROR "OpenCV is not available on current platform")
+  set(OPENCV_SUFFIX "ubuntu20")
endif()

Кроме того, на последнем шаге есть две ошибки ввода

$ source /usr/local/bin/setupvars.sh

В строке 101 вместо «elif» вместо «elif» есть «eliif» и строка Следует прокомментировать 131.

Кроме того, работал как шарм.

0
ответ дан 30 July 2020 в 22:10

I have successfully setup OPENVINO in Kubuntu20.04. Steps I have followed is described below.

$ sudo apt-get install libopencv-dev python3-opencv python3 python3-pip python3-virtualenv libgfortran5
$ git clone https://github.com/openvinotoolkit/openvino.git

(hash -95677afe29206af7219a7648728f880667bcd989)

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:openvino/bin/intel64/Release/lib 
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:openvino/build/lib 
$ cd openvino
$ git submodule update --init --recursive
$ chmod +x install_dependencies.sh
$ ./install_dependencies.sh
$ mkdir build && cd build

You have to make some changes in code before continuing

(+ for adding , - for removing)

(1)file- /scripts/setupvars/setupvars.sh

line 97

  if [ -z "$python_version" ]; then
+    if command -v python3.8 >/dev/null 2>&1; then
+        python_version=3.8
+        python_bitness=$(python3.8 -c 'import sys; print(64 if sys.maxsize > 2**32 else 32)')
-    if command -v python3.7 >/dev/null 2>&1; then    
+    elif command -v python3.7 >/dev/null 2>&1; then
        python_version=3.7
        python_bitness=$(python3.7 -c 'import sys; print(64 if sys.maxsize > 2**32 else 32)')    
    elif command -v python3.6 >/dev/null 2>&1; then   

line 129

 if [ ! -z "$python_version" ]; then
-    if [ "$python_version" != "2.7" ]; then
-         add path to OpenCV API for Python 3.x
-        export PYTHONPATH="$INTEL_OPENVINO_DIR/python/python3:$PYTHONPATH"
-    fi
     # add path to Inference Engine Python API
     export PYTHONPATH="$INTEL_OPENVINO_DIR/python/python$python_version:$PYTHONPATH"
 fi

(2)file- /inference-engine/src/gna_plugin/gna_helper.cpp

line 59 in function profilerRtcStart(intel_gna_profiler_rtc *p)

-ftime(&p->start);
+timespec start;
+clock_gettime(CLOCK_REALTIME, &start);
+p->start.time = start.tv_sec;
+p->start.millitm = start.tv_nsec/1000000;

line 68 in function profilerRtcStop(intel_gna_profiler_rtc *p)

-ftime(&p->stop);
+timespec stop;
+clock_gettime(CLOCK_REALTIME, &stop);
+p->stop.time = stop.tv_sec;
+p->stop.millitm = stop.tv_nsec/1000000;

(3)file- /inference-engine/thirdparty/ade/sources/ade/source/execution_engine.cpp

line 140 in function std::unique_ptr ExecutionEngine::createExecutable(const Graph& graph)

-return std::move(ret);
+return ret;

(4)file- /model-optimizer/install_prerequisites/install_prerequisites

line 75

-sudo -E apt -y install python3-pip python3-venv libgfortran3
+sudo -E apt -y install python3-pip python3-virtualenv libgfortran5

Go to build folder.

$ cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CLDNN=OFF -D OpenCV_DIR=/usr/lib/x86_64-linux-gnu/cmake/opencv4  -DENABLE_PYTHON=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.8.so -DPYTHON_INCLUDE_DIR=/usr/include/python3.8  ..

Note-:option -DENABLE_CLDNN=OFF disables GPU

$ make --jobs=$(nproc --all)
$ sudo make install
$ sudo ldconfig
$ cd ../model-optimizer

If your /tmp directory does not have enough space(require more than 4 GB), then assign an alternate temporary folder for python. Run export TMPDIR=

$ pip3 install -r requirements.txt 
$ cd install_prerequisites
$ ./install_prerequisites.sh
$ cd ..
$ cat <<EOF > 97-myriad-usbboot.rules
SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idProduct}=="2485", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
EOF
$ sudo cp 97-myriad-usbboot.rules /etc/udev/rules.d/
$ sudo udevadm control --reload-rules
$ sudo udevadm trigger
$ sudo ldconfig

Now Installation of openvino is over.

  1. Compiled c and c++ example are present in folder- ~/inference_engine_samples_samples_build/intel64/Release/
  2. python examples are present in folder- /usr/local/deployment_tools/inference_engine/samples/python/
  3. Installation won't copy model-optimizer(/model-optimizer) into root directory

For more examples download open_model_zoo

  1. git clone https://github.com/opencv/open_model_zoo.git
  2. Go to /demos/ and run ./build_demos.sh
  3. Compiled c and c++ examples goes to folder- ~/omz_demos_build/intel64/Release/
  4. /tools/downloader/ contains downloader.py to download models. By default downloader downloader downloads models in '/tools/downloader/public' or '/tools/downloader/intel' folder

Before using model-optimizer or python sample, ensure to run

$ source /usr/local/bin/setupvars.sh
0
ответ дан 30 July 2020 в 22:10

Другие вопросы по тегам:

Похожие вопросы: