zoukankan      html  css  js  c++  java
  • 编译Caffe(ubuntu-15.10-desktop-amd64,无Cuda)

    编译环境

    VMWare Workstation 12 Player

    ubuntu-15.10-desktop-amd64

    cpu 4700mq,给vm分配了6个核心+4GB内存+80GB硬盘

    编译步骤

    主要参考了caffe官网

    http://caffe.berkeleyvision.org/install_apt.html

    1. 安装基本包

    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

    CUDA:由于显卡是750m,不支持cuda,就不弄了

    BLAS:sudo apt-get install libatlas-base-dev

    Python:sudo apt-get install python-dev

    Other:sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

    2. 下载caffe & 配置

    直接去github下载最新的caffe:https://github.com/BVLC/caffe   点击Download ZIP按钮即可下载 caffe-master.zip

    unzip caffe-master.zip

    cd caffe-master

    根据官网的指引http://caffe.berkeleyvision.org/installation.html#compilation,复制以及修改Makefile.config文件

    cp Makefile.config.example Makefile.config

    由于我没有支持cuda的gpu,因此需要将

    # CPU_ONLY := 1 

    这一行取消注释,表明只用CPU进行计算

    3. 编译

    make all
    make test
    make runtest

    头两个make可以添加 -j6参数以多线程编译,提高效率

    最后一个make是跑测试用的,使用多线程不能提高速度

    可能遇到的问题

    make all的时候,发生错误,错误提示为:

    hdf5.h could not be found

    1. sudo apt-get install libhdf5-dev

    2. 修改Makefile.config文件

    INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

    3. 添加link关系

    cd /usr/lib/x86_64-linux-gnu
    sudo ln -s libhdf5_serial.so.8.0.2 libhdf5.so
    sudo ln -s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so

    引用自https://github.com/BVLC/caffe/issues/2347

    然后重新编译即可

  • 相关阅读:
    [HDOJ1261]最少拦截系统
    Gym 100637F F. The Pool for Lucky Ones
    Codeforces Gym 100637A A. Nano alarm-clocks 前缀和处理
    HDU 1166 敌兵布阵 线段树
    【Tyvj1038】忠诚 线段树
    Codeforces Gym 100513G G. FacePalm Accounting
    Codeforces Round #313 (Div. 2)B.B. Gerald is into Art
    Codeforces Round #313 (Div. 2) D. Equivalent Strings
    Codeforces Round #313 (Div. 2) C. Gerald's Hexagon 数学
    Codeforces Round #313 (Div. 2) A. Currency System in Geraldion
  • 原文地址:https://www.cnblogs.com/stevenczp/p/5183304.html
Copyright © 2011-2022 走看看