caffe安装

C接口:

安装caffe所需库,按照官方要求安装。

将Makefile.config.example复制为Makefile.config,打开修改一些配置。

# USE_CUDNN := 1 GPU版,使用cudnn库则放开;

#CPU_ONLY := 1 CPU版要放开,GPU版不需要;

CUSTOM_CXX := g++;

CUDA_DIR := /usr/local/cuda GPU版;

CUDA_ARCH := -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  不同型号、计算能力的GPU要求不一样,根据提示删减一些;

# open for OpenBlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
BLAS_INCLUDE := /home/liushu/env/OpenBLAS/include

BLAS_LIB := /home/liushu/env/OpenBLAS/lib  选择不同的库及对应路径


make clean;make -j

Python 接口:

make clean;make -j

make pycaffe

其中make pycaffe的时候会提示缺少一些Python相关库,按提示安装即可。

其中,make pycaffe的时候提示Python2.7库问题(/usr/bin/ld: cannot find -lpython2.7),如下,其实/usr/ 下已经安装了Python,


后来去Makefile.config里修改,放开了这段,就可以了,而之前在别的机器上编译的时候不需要这样。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值