caffe ubuntu14.04 cuda 7.0 安裝筆記

現在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 all
make test
make runtest

基本完成了,編譯一下pycaffe。

7、編譯一下pycaffe。注意需要在makefile.config文件中看一下路徑對不對,一般python配置不需要變動。

make pycaffe

測試有沒有成功,cd到caffe目錄下的python文件夾,然後執行:

python

import 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: 點擊打開鏈接

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章