Caffe配置安装

最近要做目标检测,安装caffe_ssd,github下载
git clone https://github.com/stoneyang/caffe_ssd.git

,发现好多人给出的链接地址是https://github.com/weiliu89/caffe.git,下载之后好像并不是ssd版的。

配置安装过程和常规caffe一样,ssd版添加了于ssd相关的代码,Makefile文件与bvlc版不太一样。

cp Makefle.config.example Makefle.config

按需求修改,主要放开以下项:

# cuDNN acceleration switch (uncomment to build with cuDNN). 
USE_CUDNN := 1
# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
CUSTOM_CXX := g++
CUDA_DIR := /usr/local/cuda-8.0
UDA_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 #注意这些选择和cuda版本相关
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# 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
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
        /usr/lib64/python2.7/site-packages/numpy/core/include \ #若要使用python接口,需放开它
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib64/python2.7/config
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /home/liushu/env/caffelib-bak3/include
LIBRARY_DIRS := $(PYTHON_LIB) /home/liushu/env/caffelib-bak3/lib #caffelib路径,重要


Makefile文件根据编译情况修改.

其中在编译caffe_ssd时提示.build_release/lib/libcaffe.so: undefined reference to `boost::re_detail_106400::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const' 与regex相关问题,找不到regex库,本来以为regex库版本问题,搞了半天是没有软链接 ln -s libboost_regex.so.1.64.0 libboost_regex.so ,解决!

 修改好编译配置文件后

make clean;make -j
make pycaffe #当要使用python接口时
//有些会有make runtest,做了尝试,主要是编译一些test开头的文件,该项编译不过程序仍可正常运行,我一般不执行该项

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值