ubuntu16.04 安装 caffe

本文介绍在Ubuntu16.04上安装Caffe。

1.首先假定已经安装Ubuntu16.04,cuda , cndnn和opencv。
2.系统安装完成后,打开命令行控制台,输入以下命令,安装基本依赖(General dependencies)。

1、sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler  
2、sudo apt-get install --no-install-recommends libboost-all-dev 

3、安装ATLAS,输入下述命令:

sudo apt-get install libatlas-base-dev 

4.安装剩余依赖:

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

5.下载Caffe:

 sudo apt-get install git  
git clone https://github.com/BVLC/caffe.git 

6.修改Makefile.config:
首先进入caffe目录,并创建Makefile.config文件:

cd caffe
gedit Makefile.config 

复制Makefile.config.example的内容到Makefile.config中,并修改以下内容:

 # Whatever else you find you need goes here.  
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include  
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib 

修改为:

 # Whatever else you find you need goes here.  
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial  
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/i386-linux-gnu/hdf5/serial  

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

7.进行编译

make all
make test
make runtest

8.编译完成

这里写图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值