【分享帖】教程 || 在秒算上配置caffe

XJTU DJI CLUB XJTU DJI CLUB | 822 | 2017-04-19

本文作者:钢蛋,权利归属原作者所有,未获得授权禁止转载!


妙算上面可以安装caffe,已测试成功.写个教程帮助后面想要安装的同学.

百度云链接:http://pan.baidu.com/share/init?shareid=3221400738&uk=1647165732密码:v037

相关安装包在“妙算”文件夹中

1. 首先是cuda的安装.

妙算中是一块TK1.cuda6.5的离线安装包已上传至百度云,请下载之后,用下列命令安装:

sudodpkg -i cuda-repo-l4t-r21.3-6-5-prod_6.5-42_armhf.deb

sudoapt-get update

sudoapt-get install cuda-toolkit-6-5

添加环境变量

QQ截图20170419200246.jpg


运行下列命令测试是否安装成功


nvcc -V

1.jpg



2. opencv4tegra的安装

在百度云下载安装包,使用如下命令安装:

sudodpkg -i libopencv4tegra-repo_l4t-r21_2.4.10.1_armhf.deb

sudoapt-get update

sudoapt-get install libopencv4tegra libopencv4tegra-dev libopencv4tegra-python

3. 接下来是caffe需要的各种依赖库,参考caffe官方Installation.


整理如下:

sudo apt-get install libprotobuf-dev libleveldb-devlibsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler

sudo apt-get install--no-install-recommends libboost-all-dev

sudoapt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

4.安装openBLAS.这个直接下载下来make,make install,然后需要更新一下ubuntu/etc/ld.so.conf.d中的文件(我在文件夹中添加了一个opencv.conf),openBLASlib路径(默认是/opt/OpenBLAS/lib)写在opencv.conf末尾,然后在终端运行

sudo ldconfig使改动生效

5.解压caffe,然后复制Makefile.config.example并重命名为Makefile.config.打开Makefile.config

1) 找到















# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52 \
-gencode arch=compute_60,code=sm_60 \
-gencode arch=compute_61,code=sm_61 \
-gencode arch=compute_61,code=compute_61


然后把最后三行注释掉.变成下面这样:
















# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52 \
#-gencode arch=compute_60,code=sm_60 \
#-gencode arch=compute_61,code=sm_61 \
#-gencode arch=compute_61,code=compute_61

2) 修改BLAS的值为open

并修改BLAS_INCLUDEBLAS_LIB的路径

BLAS_INCLUDE:=/opt/OpenBLAS/include

BLAS_LIB:=/opt/OpenBLAS/lib

6.cd caffe的目录下,编译

make all

make test

make runtest



2.jpg

请问这篇文章对你有用吗?

【分享帖】教程 || 在秒算上配置caffe
所有评论
暂无更多
暂无更多
关于作者
XJTU DJI CLUB
XJTU DJI CLUB
0 关注Ta
0 文章
0 经验值
0 获赞

目录

评论