CAFFE+FASTERCNN安裝記錄

來源:互聯網
上載者:User

標籤:

本文記錄了ubuntu15.10上面安裝caffe和運行fasterRcnn的過程,把其中遇到的問題和解決辦法記錄一下,以備查看。

主要參考

http://ouxinyu.github.io/Blogs/20151108001.html

Caffe + Ubuntu 15.04 + CUDA 7.5 新手安裝配置指南

http://blog.csdn.net/helloeveryon/article/details/48789079

1:安裝Ubuntu

下載ubuntu15.10,用ultraiso做成啟動盤,然後安裝。安裝過程中,忘了手動分配swap交換分區,系統自動分配的

問題:ubuntu系統安裝好後,檔案名稱顯示不全。

解決:是因為顯卡驅動問題,安裝CUDA驅動就可以了。

 

2:安裝CUDA顯卡驅動

先把錯配的顯卡驅動清理乾淨

sudo apt-get --purge remove nvidia-*

到https://developer.nvidia.com/cuda-downloads下載對應的deb檔案

到deb的下載目錄下

sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb

sudo apt-get update

sudo apt-get install cuda

sudo reboot

完成,cuda和顯卡驅動就都裝好了;其他的什麼都不用動

而網上大部分中文和英文的參考教程都是過時的,折騰幾個小時不說還容易裝不成。

 

3:安裝CUDA顯卡驅動

安裝Intel MKL 或Atlas,沒有參考博文中的方法,偷懶裝的Atlas

安裝命令:

sudo apt-get install libatlas-base-dev

 

4:安裝OPENCV3.1.0

http://www.tuicool.com/articles/nYJrYra ubuntu +opencv3.1 安裝指南

 問題:

(1):file included from /usr/local/cuda/include/cuda_runtime.h:76:0, from <command-line>:0:/usr/local/cuda/include/host_config.h:115:2: error: #error -- unsupported GNU version! gcc versions later than 4.9 are not supported! #error -- unsupported GNU version! gcc versions later than 4.9 are not supported! ^

You can try install gcc-4.9 and g++-4.9 to solve this problem temporarily. But the linker will report undefined references errors later because all other libraries (protobuf,leveldb,opencv) in Ubuntu 15.10 are compiled with GCC version 5.2. They are not compatible.

 --- #error -- unsupported GNU version! gcc versions later than 4.9 are not supported!+++ //#error -- unsupported GNU version! gcc versions later than 4.9 are not supported!

 解決:To solve this problem we have to "hack" the CUDA toolkit by editing /usr/local/cuda/include/host_config.h. Comment line 115.

 

(2)在帶有中文名字的檔案夾中進行 make opencv3.0,導致錯誤,以後一定要避免有中文名字。

 

(3) 修改Makefile檔案(不是Makefile.config)

在位置((LIBRARIES+= glog gflags protobuf leveldb snappy \lmdbboost_system hdf5_hl hdf5 m \

opencv_coreopencv_highgui opencv_imgproc opencv_imgcodecs))處

 添加opencv_imgcodecs

 這一步非常重要,否則編譯後會出現錯誤如下:

 

原因就是opencv3.0.0把imread相關函數放到imgcodecs.lib中了,而非原來的imgproc.lib

 

4:安裝FASTER RCNN

部落格中內容:將你之前配置過的CaffeMakefile.config拷貝至./faster-rcnn/external/caffe,記得修改Matlab介面,接著編譯就可以了。

(1)這一步,千萬不能把makefile檔案也copy過去,否則後面make matcaffe 會導致找不到一些庫檔案路徑。找不到GPU的標頭檔。

(2)caffe下面產生的build檔案夾是軟連結不能直接copy使用。

 

(3)直接copy的其他人的模型,導致出現下面錯誤,還是老實點從作者Baidu雲端硬碟下吧。

MATLAB被殺死,記憶體如果不足,會提示out of memory。

 

 

CAFFE+FASTERCNN安裝記錄

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.