|
Snapdragon Neural Processing Engine SDK
Reference Guide
|
The chapter walks through the setup of tools required for SNPE and the SDK installation.
Create list of alternatives for python
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
Check the python list
$ update-alternatives --list python
update alternative to select required python version
$ sudo update-alternatives --config python Instructions for setting up the SDK environment are as follows.
unzip -X snpe-X.Y.Z.zip
source snpe-X.Y.Z/bin/dependencies.sh
Run the python dependency checker to check the system for python package dependencies. Install the missing packages.
source snpe-X.Y.Z/bin/check_python_depends.sh
Python package versions tested with the SNPE SDK are:
$SNPE_ROOT refers to the directory path where the SNPE SDK is installed.
cp <path_to_libatomic>/libatomic.so.1 $SNPE_ROOT/lib/aarch64-linux-gcc4.9/
Building the Native C++ Example (Building Your First SNPE Native App) on Android requires the Android NDK installed with the ANDROID_NDK_ROOT exported as per the command below.
export ANDROID_NDK_ROOT=<path_to_ndk>
If the ANDROID_NDK_ROOT is not set the environment setup script will attempt to find the NDK path by searching for ndk-build.
Environment setup for Caffe
Go to $SNPE_ROOT and run the following script to setup the SNPE SDK environment. The location of the Caffe directory must be provided.
source bin/envsetup.sh -c $CAFFE_DIR
where $CAFFE_DIR is the path to the Caffe installation.
SNPE_ROOT: root directory of the SNPE SDK installation CAFFE_HOME: root directory of the Caffe installation you provided ($CAFFE_DIR)
Environment setup for Caffe2
Go to $SNPE_ROOT and run the following script to setup the SNPE SDK environment. The location of the Caffe2 directory must be provided.
source bin/envsetup.sh -f $CAFFE2_DIR
where $CAFFE2_DIR is the path to the Caffe2 installation.
SNPE_ROOT: root directory of the SNPE SDK installation CAFFE2_HOME: root directory of the Caffe2 installation you provided ($CAFFE2_DIR)
Environment setup for TensorFlow
source bin/envsetup.sh -t $TENSORFLOW_DIR
where $TENSORFLOW_DIR is the path to the TensorFlow installation.
SNPE_ROOT: root directory of the SNPE SDK installation TENSORFLOW_HOME: root directory of the TensorFlow installation provided
Environment setup for ONNX
source bin/envsetup.sh -o $ONNX_DIR
where $ONNX_DIR is the path to the ONNX installation.
SNPE_ROOT: root directory of the SNPE SDK installation ONNX_HOME: root directory of the TensorFlow installation provided
Environment setup for TFLite
source bin/envsetup.sh
SNPE_ROOT: root directory of the SNPE SDK installation