SSD: Single Shot MultiBox Detector 編譯方法總結


SSD是一個基於單網絡的目標檢測框架,它是基於caffe實現的,所以下面的教程是基於已經編譯好的caffe進行編譯的。 caffe的編譯可以參考官網 caffe Installation

Installation

1.Get the code.

git clone https://github.com/weiliu89/caffe.git    (這里會得到一個caffe目錄,為了和我們之前的caffe區分,我們下面對其重命名)
mv caffe caffe-ssd
cd caffe-ssd
git checkout ssd

2.Build the code.

從之前編譯好的caffe目錄中(我安裝在/下),拷貝Makefile.config到caffe-ssd(我安裝在/)中:

cp ~/caffe/Makefile.config ~/caffe-ssd/

編譯之前需要修改配置文件:

1.首先添加caffe中的python到python環境變量中(PYTHONPATH),在.bash_profile里添加:

export PYTHONPATH=$PYTHONPATH:~/caffe/python

2.在.bash_profile 下面 添加共享blas庫的路徑(我安裝在~/下),以及共享cuda的路徑

export LD_LIBRARY_PATH=~/OpenBLAS/lib/
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda

3.使修改文件生效

source  .bash_profile

4.在caffe-ssd下編譯

make -j8
make py
make test -j8
make runtest -j8

說明

如果編譯之前,不做第2步的話,可能出現一下錯誤:

.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libcudart.so.7.5: cannot open shared object file: No such file or directory
make: *** [runtest] Error 127

.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libopenblas.so.0: cannot open shared object file: No such file or directory
make: *** [runtest] Error 127

參考

SSD: Single Shot MultiBox Detector Installation


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM