caffe配置过程

Posted 帅气的小王子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了caffe配置过程相关的知识,希望对你有一定的参考价值。

Prerequisites

 

    1.BLAS via ATLAS, MKL, or OpenBLAS.

    2.Boost >= 1.55

    3.protobuf, glog, gflags, hdf5

    4.OpenCV >= 2.4 including 3.0

 

Optional dependencies:

 

    1.CUDA is required for GPU mode.

        library version 7+ and the latest driver version are recommended, but 6.* is fine too

        5.5, and 5.0 are compatible but considered legacy    

    2.IO libraries: lmdb, leveldb (note: leveldb requires snappy)

    4.cuDNN for GPU acceleration (v6)

 

1)Install cmake-3.9

  1) unzip cmake_3.9.zip

  2) cd CMake_master

  3) ./bootstrap --prefix=/data0/sina_cre/install/local/cmake_3.9

  4) make

  5) make install

2)Install Boost_1_64_0

  1. unzip boost_1_64_0.zip

  2. cd boost_1_64_0

  3. ./bootstrap.sh --with-python=/data0/sina_cre/python/bin/python

  4. ./b2 install --prefix=/data0/sina_cre/install/local/boost_1_64_0/

3)Install Opencv-2.4.11

  1. unzip opencv-2.4.11.zip

  2. cd opencv-2.4.11

  3. mkdir release  

  4. cd release

  5. cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/data0/sina_cre/install/local/opencv-2.4.11 BUILD_PYTHON_SUPPORT=ON WITH_FFMPEG=YES -D CUDA_GENERATION=Kepler  -DOPENCV_EXTRA_MODULES_PATH=/data0/home/wangchao16/package/opencv_contrib-master/modules/  (3.2 -D WITH_LIBV4L=ON).. 

  6. make

  7. make install

4)Install OpenBLAS-0.2.19

  1. tar xf openblas-0.2.19.tar.gz

  2. cd OpenBLAS-0.2.19/

  3. make

  4. make PREFIX=/data0/sina_cre/install/local/openblas-0.2.19 install

5)Install protobuf-3.3.0

  1. unzip protobuf-3.3.0.zip

  2. cd protobuf-master

  3. ./autogen.sh

  4. ./configure --prefix=/data0/sina_cre/install/local/protobuf-3.3.0

  5. make

  6. make check

  7. make install

6)Install glog

  1. unzip glog.zip

  2. cd glog-master

  3. ./autogen.sh

  4. ./configure --prefix=/data0/sina_cre/install/local/glog

  5. make

  6. make install

7)Install gflags

  1. unzip glags.zip

  2. cd gflags-master

  3. mkdir build && cd build

  4. ccmake ..

 

      - Press 'c' to configure the build system and 'e' to ignore warnings.

      - Set CMAKE_INSTALL_PREFIX and other CMake variables and options.

      - Continue pressing 'c' until the option 'g' is available.

      - Then press 'g' to generate the configuration files for GNU Make.

 

  5. make

  6. make install (optional)

8)Install hdf5-1.8.19

  1. tar xf hdf5-1.8.19

  2. cd hdf5-1.8.19

  3. ./configure --prefix=/data0/sina_cre/install/local/hdf5-1.8.19

  4. make

  5. make check

  6. make install

  7. make check-install

9)Install leveldb

  1. unzip leveldb.zip

  2. cd leveldb-master

  3. make

  4. cp -r out-shared lib

  5. cp -r leveldb-master/ /data0/sina_cre/install/local/leveldb

10)Install LMDB_0.9.21

  1. tar xf LMDB_0.9.21.tar.gz

  2. cd lmdb-LMDB_0.9.21/libraries/liblmdb

  3. make

  4. cp -r liblmdb /data0/sina_cre/install/local/

11)Install snappy

  1. unzip snappy.zip

  2. mkdir build

  3. cd build && cmake -DCMAKE_INSTALL_PREFIX=/data0/sina_cre/install/local/snappy ../ && make

 

12)Install caffe

  1. cp Makefile.config.example Makefile.config

  2. edit Makefile.config

  3. make all

  4. make test

  5. make runtest

  6. make pycaffe

Makefile .config示例

 

Q:can not find module skimage.io

A:pip install scikit-image

Q:module compiled against API version 0xa but this version of numpy is 0x9

A:pip install numpy --upgrade

Q:No module named google.protobuf

A:pip install protobuf

Q:No module named cv2

A:pip install opencv-python

Q:找不到ffmepg

A:export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig;$PKG_CONFIG_PATH

Q:为什么我的opencv2.4版本ffmpeg编译不过

A:opencv2.4需要搭配低版本ffmepg(2.8而非3.3)

Q: Unsupported gpu architecture 'compute_11'

A:-D CUDA_GENERATION=Kepler

Q:Unable to stop the stream: Inappropriate ioctl for device

A:https://www.linuxtv.org/downloads/v4l-utils/ 装个v4l,重新编opencv

Q:为什么opencv读视频一直返回False

A:pip安装的opencv和编译安装的opencv只保留一个。

Q:ffmepg抽帧速度满

A:--disable-yasm要设成enable

以上是关于caffe配置过程的主要内容,如果未能解决你的问题,请参考以下文章

[转]caffe的配置过程

caffe配置过程

caffe配置过程

caffe 配置过程中遇到的错误

Ubuntu16.04 安装配置 Caffe 过程 (GPU版+CUDA 9.0+cuDNN 9.0+OpenCV 3.4.1)

caffe学习------配置