caffe ubuntu14.04 cuda 7.0 安装笔记

来源:互联网 发布:ios socket编程 demo 编辑:程序博客网 时间:2024/04/28 18:16

现在caffe的安装已经很人性化了,今天上午用了不到一个小时,就装好了,当然,之前为了安装yolo-darknet、tensorflow 已经装好了一些软件,比如cuda/cudnn/opencv3.0等等。


参考的就是官方安装教程,挺人性化,步骤也很清晰,在这里做个笔记,不排除以后要重装系统。建议大家参考官方安装教程。


1、在官方安装教程页面,点击进入“Ubuntu installation ”根据教程,先安装通用依赖(General dependencies)

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

2、再安装cuda 和cudnn(省略,挺好装的,英伟达下载cuda页面有写安装的命令。设置好cuda和cudnn的路径就好了。)


3、安装BLAS

sudo apt-get install libatlas-base-dev

4、安装python 这个每个linux系统自带的,我的是2.7.6版本,没觉得不好用,就一直用它。


5、ubuntu系统版本与软件兼容问题,如果是ubuntu16.04 那么cuda 必须安装CUDA8.如果是ubuntu14.04 Everything is packaged。继续运行命令


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

6、接下来就是编译了。

(1)、先git caffe

git clone https://github.com/BVLC/caffe.git

(2)、把这个文件夹放在任何你想放的地方。然后cd到这个caffe目录。编译之前,配置一下Makefile.config。这个也得给官方网站点个赞!虽然没有直接的Makefile.config这个文件,但是有一个Makefile.config.example的示例,想要设置什么参数都在里面。所以我们如果想配置一下这个文件,copy一份Makefile.config.example,重命名为Makefile.config,里面设置你想设置的参数,其中如果使用了opencv3.0版本的,需要将对应的一行uncomment一下。

cp Makefile.config.example Makefile.config

(3)、正式编译测试

make allmake testmake runtest

基本完成了,编译一下pycaffe。

7、编译一下pycaffe。注意需要在makefile.config文件中看一下路径对不对,一般python配置不需要变动。

make pycaffe

测试有没有成功,cd到caffe目录下的python文件夹,然后执行:

pythonimport caffe

8、我做第七步骤的时候有错误,说没有安装skimage。那就安装一下就好了。

sudo apt-get install python-skimage

重复步骤七,成功。


感想,想想以前在windows上安装caffe折腾的,现在caffe真是越来越好。大家安装个还是建议参考官方安装教程,因为网上的博客都有时效性,紧跟官方步伐才是根本。


参考:http://caffe.berkeleyvision.org/installation.html

//update 2017.01.09

install opencv-3.0-beta

reference: 点击打开链接

encounter the problem:

error: ‘nppiGraphcut8_32f8u’ was not declared in this scope

solutions: 点击打开链接

as far as I am concerned,the referred path is actually not correct, graphcuts.cpp is in the path ..modules/cuda/src/graphcuts.cpp


still, I found one blog about installing matlab-2014a which discribesvery well, I will suggest you all.

matlab 2014a: 点击打开链接

0 0
原创粉丝点击