rk3399pro上安装rknnplugin的各模型测试

# DIY operators rknnplugin

环境:RK3399pro + fedora

[![GitHub license](http://OAID.github.io/pics/apache_2.0.svg)](./LICENSE)

 

1. 下载Tengine [Tengine in GitHub]([email protected]:8022/internal/tengine.git)

git clone [email protected]:8022/internal/tengine.git
cd Tengine


2. Checkout tag v1.3.2    

git  checkout -b v1.3.2 v1.3.2


3. Build Protobuf

git clone [email protected]:protocolbuffers/protobuf.git        
cd protobuf        
git checkout -b v3.5.0 v3.5.0        
./autogen.sh        
./configure --with-protoc=protoc       
make -j4        
make install


4. Build opencv

git clone [email protected]:opencv/opencv.git 
#(https://github.com/opencv/opencv.git)
git checkout -b 3.4.0 3.4.0
cd opencvcp build_opencv.sh .
mkdir build
cd build
../build_opencv.sh
make -j4
sudo make install

5. Build Tengine

mkdir build
./linux_build.sh default_config/arm64_linux_native.config 
make -j4
make install

6. Download rknn SDK. see [Toybrick]

      此处我下载的是rknn-api-0.9.9,放置在home目录下备用。

7. Build rknnplugin

cd  #此处是你的rknnplugin根目录       
mkdir build        
cd build          
vim ../linux_build.sh

需要将tengin的根路径、将要安装至哪里的路径、rknn SDK的根路径 指定对。
rk3399pro上安装rknnplugin的各模型测试_第1张图片
 

../linux_build.sh        
cmake ../        
make -j4  
make install

若有一些找不到路径的错误,可以尝试以下修改:

1.在rknnplugin-master/CMakeLists修改

set(LIB_PATH ${RKNN_SDK_PATH}/rknn_api/arm/lib64)

include_directories(${RKNN_SDK_PATH}/rknn_api/arm/include)

set(LIB_PATH ${RKNN_SDK_PATH}/rknn_api/arm/lib64)

include_directories(${RKNN_SDK_PATH}/rknn_api/arm/include)

2.在rknnplugin-master/rknn/CMakeLists.txt 中修改

include_directories(${RKNN_SDK_PATH}/rknn_api/arm/include)

include_directories(${RKNN_SDK_PATH}/rknn_api/include)

  #可能会报错,说thread_->Activate(-1);    thread_->Deactivate(); 没有这个成员函数,注释掉它们即可。


8.测试

export LD_LIBRARY_PATH=/install:/install/lib        
cp /rknn-api/Linux/tmp/* . -rf        
../install/test_rknn_mobilenet

在./install/目录下有若干个程序可供测试使用。可以一一尝试。
 

谨记:如果更改了.cpp文件,一定要记得make && make install。

你可能感兴趣的:(编程,linux,bash)