高通骁龙snpe 编译配置运行

转载请注明出处:https://blog.csdn.net/qq_27262241/article/details/110930325
I’ll make a Snpe Docker Image to fuck the shit compile process.

硬件准备

  • 笔记本电脑: 安装ubuntu16.04
  • 手机:搭载高通骁龙处理器
  • usb线

安装

不踩坑指南: 要先装caffe, 再装python虚拟环境 最后装 TensorFlow,否则protocol会冲突

1 编译caffe

参考链接

准备

#下载
git clone https://github.com/BVLC/caffe.git
# 安装依赖
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libatlas-base-dev

还要安装:


apt-get install libgflags-dev 
sudo apt-get install libgoogle-glog-dev

修改编译选项

cd <caffe目录>
cp Makefile.config.example Makefile.config

在caffe目录下,修改 Makefile.config

#给INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include添加   /usr/include/hdf5/serial
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial

#给 LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib 添加  /usr/lib/x86_64-linux-gnu/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial


#中把 CPU_ONLY=1行取消注释。
CPU_ONLY=1

修改Makefile

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
# 改为
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

编译运行

make all # 这一步骤会出现很多错误,参考文末,caffe错误总结
make test 
make runtest
make distribute
make pycaffe

2 安装python3.5+tensorflow

安装miniconda

先下载 ubuntu64位 https://repo.anaconda.com/miniconda/Miniconda2-latest-Linux-x86_64.sh

然后运行 bash *.sh

更换conda源

更换清华源

show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

安装python3.5虚拟环境

conda create -n py35 python=3.5

激活虚拟环境

co
  • 4
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值