Skip to content

Latest commit

 

History

History
103 lines (79 loc) · 3.73 KB

README.md

File metadata and controls

103 lines (79 loc) · 3.73 KB

Vivante network models

  • Inceptionv3
  • Yolov3

A case code is automatically generated by Vivante tool (e.g., Acuity tool) by default. The case code of a network model is imported from the below GitHub website.

  • nbg_unify_inception_v3: This folder is a unified network binary graph files for inceptionv3.
  • nbg_unify_yolov3: This folder is a unified network binary graph files for yolov3.
  • TBA

Prerequisite

First of all, you must download the "aml_npu_sdk.tgz" file at an official webapge of Khadas.

Then, you have to decompress the files in the below folder as follows.

  • Ubuntu x86_64 (cross compile): ~/npu/
  • Tizen 6.0 arm32 (native build): ~/mnt/sda2 (Mount a folder with a USB storage)

How to build

For the VIM3/Ubuntu18.04(arm64) board

This section describes how to build both libinceptionv3.so (for dlopen) and inceptionv3 (for ELF file).

ubuntu$ sudo apt install gcc-aarch64-linux-gnu
ubuntu$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ubuntu$ vi mybuild.sh
shared=1
ubuntu$ ./mybuild-ubuntu.sh
ubuntu$ ls -al ./bin_r
ubuntu$ scp -r ./bin_demo/ [email protected]:.
ubuntu$ scp -r ./bin_r/    [email protected]:. 

For the RPi3/Tizen 6.0(aarch64) board

This section describes how to execute a native build on VIM3 target board. In case of Tizen, you have to compile the source codes on the Tizen target board.

First of all, please install zypperp package to manage required packages. Then, you must specify the architecutre name in order to install correct rpm files with zypper command.

target# vi /etc/zypp/zypp.conf
## Override the detected architecture
# arch = s390
arch = armv7l


In the office, we sometimes meet network connection issue due to the firewall policy of the company.
In this case, you must append proxy address as folows. Note that some IP addresses does not use a proxy environment.
target$ cat /etc/profile
# proxy setting for a compnay firewall
export http_proxy="http://10.112.xxx.xxx:8080/"
export https_proxy="http://10.112.xxx.xxx:8080/"
export no_proxy="localhost,127.0.0.1,165.213.149.200,10.113.136.32,github.sec.samsung.net"

target# source /etc/profile 

target# zypper ar http://download.tizen.org/snapshots/tizen/base/latest/repos/standard/packages/ tizen-base

target# zypper ar http://download.tizen.org/snapshots/tizen/unified/latest/repos/standard/packages/ tizen-unified

target# rm -rf /var/cache/zypp*
target# rpmdb --rebuilddb
target# zypper clean
target# zypper refresh 

Then, install Vivante packages.

vim3/tizen# zypper install binutils gcc libgcc gcc-c++
vim3/tizen# zypper install amlogic-vsi-npu-sdk-devel
vim3/tizen# 

Then, compile the source code.

vim3/tizen# vi mybuild-tizen.sh
shared=1
vim3/tizen# ./mybuild-tizen.sh
vim3/tizen# ls -al ./bin_r

How to run

This section describes how to run ELF files with three methods (e.g., Static linking, Dynamic linking (w/o dlopen), and Dynamic loading (with dlopen)). The generated files have to be run normally with the below methods on VIM3 board/Ubuntu18.04(arm64) and RPi3/Tizen 6.0(arm32).

vim3# cd ./bin_r/
vim3# ./inceptionv3      ../bin_demo_20200106_1900/inception_v3.nb  ../bin_demo_20200106_1900/goldfish_299x299.jpg
vim3# ./filter_nodlopen  ../bin_demo_20200106_1900/inception_v3.nb  ../bin_demo_20200106_1900/goldfish_299x299.jpg
vim3# ./filter_dlopen    ../bin_demo_20200106_1900/inception_v3.nb  ../bin_demo_20200106_1900/goldfish_299x299.jpg

Terminology

  • TBA: To Be Added