安装
git
git clone https://github.com/BVLC/caffe.git
编译
cp Makefile.config.example Makefile.config
修改Makefile.config
OPENCV_VERSION := 3
..................
CUDA_DIR := /usr/local/cuda-8.0
..................
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) ~/3d/opencv/build/lib /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial
make all -j8
验证是否编译成功
make runtest -j8
返回如下结果,说明安装成功了
[----------] 10 tests from EltwiseLayerTest/1, where TypeParam = caffe::CPUDevice<double>
[ RUN ] EltwiseLayerTest/1.TestSum
[ OK ] EltwiseLayerTest/1.TestSum (0 ms)
[ RUN ] EltwiseLayerTest/1.TestMaxGradient
[ OK ] EltwiseLayerTest/1.TestMaxGradient (2 ms)
[ RUN ] EltwiseLayerTest/1.TestSumGradient
[ OK ] EltwiseLayerTest/1.TestSumGradient (3 ms)
[ RUN ] EltwiseLayerTest/1.TestSumCoeffGradient
[ OK ] EltwiseLayerTest/1.TestSumCoeffGradient (2 ms)
[ RUN ] EltwiseLayerTest/1.TestStableProdGradient
[ OK ] EltwiseLayerTest/1.TestStableProdGradient (2 ms)
[ RUN ] EltwiseLayerTest/1.TestProd
[ OK ] EltwiseLayerTest/1.TestProd (0 ms)
[ RUN ] EltwiseLayerTest/1.TestSetUp
[ OK ] EltwiseLayerTest/1.TestSetUp (0 ms)
[ RUN ] EltwiseLayerTest/1.TestUnstableProdGradient
[ OK ] EltwiseLayerTest/1.TestUnstableProdGradient (2 ms)
[ RUN ] EltwiseLayerTest/1.TestMax
[ OK ] EltwiseLayerTest/1.TestMax (0 ms)
[ RUN ] EltwiseLayerTest/1.TestSumCoeff
[ OK ] EltwiseLayerTest/1.TestSumCoeff (0 ms)
[----------] 10 tests from EltwiseLayerTest/1 (11 ms total)
[----------] 8 tests from RMSPropSolverTest/3, where TypeParam = caffe::GPUDevice<double>
[ RUN ] RMSPropSolverTest/3.TestRMSPropLeastSquaresUpdateWithWeightDecay
[ OK ] RMSPropSolverTest/3.TestRMSPropLeastSquaresUpdateWithWeightDecay (7 ms)
[ RUN ] RMSPropSolverTest/3.TestRMSPropLeastSquaresUpdateWithRmsDecay
[ OK ] RMSPropSolverTest/3.TestRMSPropLeastSquaresUpdateWithRmsDecay (34 ms)
[ RUN ] RMSPropSolverTest/3.TestSnapshot
[ OK ] RMSPropSolverTest/3.TestSnapshot (19 ms)
[ RUN ] RMSPropSolverTest/3.TestLeastSquaresUpdateWithEverythingAccum
[ OK ] RMSPropSolverTest/3.TestLeastSquaresUpdateWithEverythingAccum (3 ms)
[ RUN ] RMSPropSolverTest/3.TestSnapshotShare
[ OK ] RMSPropSolverTest/3.TestSnapshotShare (23 ms)
[ RUN ] RMSPropSolverTest/3.TestLeastSquaresUpdateWithEverythingAccumShare
[ OK ] RMSPropSolverTest/3.TestLeastSquaresUpdateWithEverythingAccumShare (4 ms)
[ RUN ] RMSPropSolverTest/3.TestRMSPropLeastSquaresUpdateWithEverything
[ OK ] RMSPropSolverTest/3.TestRMSPropLeastSquaresUpdateWithEverything (36 ms)
[ RUN ] RMSPropSolverTest/3.TestRMSPropLeastSquaresUpdateWithEverythingShare
[ OK ] RMSPropSolverTest/3.TestRMSPropLeastSquaresUpdateWithEverythingShare (40 ms)
[----------] 8 tests from RMSPropSolverTest/3 (166 ms total)
[----------] Global test environment tear-down
[==========] 2131 tests from 271 test cases ran. (239496 ms total)
[ PASSED ] 2131 tests