RKNN Toolkit - 在X86和RK3399pro部署

运行环境: X86, Linux16.04, python3.6
下载rknn_toolkit: https://eyun.baidu.com/s/3nwnPxsX#sharelink/path=%2F

运行下列commands:
sudo apt-get install python3.6
sudo apt-get install python3-pip
cd package/
pip3 install tensorflow (>1.11, <2.0)
pip3 install opencv-python (> 3.4.1)
sudo pip3 install rknn_toolkit-1.2.1-cp36-cp36m-linux_x86_64.whl

检测rknn是否安装成功:
rk@rk:~/rknn-toolkit-v1.2.1/package$ python3

from rknn.api import RKNN

在rk3399pro上部署环境
参考官网:
http://wiki.t-firefly.com/zh_CN/3399pro_npu/npu_rknn_toolkit.html#cheng-xu-an-zhuang

在3399Pro中安装
Ubuntu 18.04

基础依赖安装:
sudo apt-get update
sudo apt-get install -y cmake python3 python3-pip python3-opencvpython3-numpypython3-h5py python3-lmdb libhdf5-serial-dev libgfortran5-dbg protobuf-compiler
pip3 install cython
pip3 install --user scipy-1.2.0-cp36-cp36m-linux_aarch64.whl
pip3 install --user onnx -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com (不要用whl)
pip3 install --user tensorflow-1.10.1-cp36-cp36m-linux_aarch64.whl -i https://mirrors.aliyun.com/pypi/simple/ -trusted-host=mirrors.aliyun.com

pip3 install --user rknn_toolkit-1.0.0-cp36-cp36m-linux_aarch64.whl -i https://mirrors.aliyun.com/pypi/simple/ -trusted-host=mirrors.aliyun.com

完成后运行python3 multi-person-openpose_rknn-cam.py

ERRORS:
1.wrong numpy version:
Solution:
run following command repeatedly until none is found
pip3 uninstall numpy

2.Fixing numpy.distutils.system_info.NotFoundError: No lapack/blas resources found on Ubuntu
Solution:
sudo apt-get -y install liblapack-dev libblas-dev
sudo apt-get install -y gfortran

3.No usable temporary directory found in [’/tmp’, ‘/var/tmp’, ‘/usr/tmp’, '/home/firefly/rknnlib’]
Solution:sudo reboot 重启电脑

4.在运行pip3 install --user rknn_toolkit-1.0.0-cp36-cp36m-linux_aarch64.whl时出现以下Error:
Command “/usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-build-sv3jji_d/scipy/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-0syk3d4r-record/install-record.txt --single-version-externally-managed --compile --user --prefix=” failed with error code 1 in /tmp/pip-build-sv3jji_d/scipy/
Solution: 加sudo。 注意使用pip时尽量不要加sudo,除非没有其他解决方法

5.raise DistutilsOptionError("can’t combine user with prefix, "
distutils.errors.DistutilsOptionError: can’t combine user with prefix, exec_prefix/home, or install_(plat)base
Solution: 手动输入命令,不要用复制黏贴,可能复制时复制了不可识别的字符

你可能感兴趣的:(深度学习)