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

    然后重新编译即可

  • 相关阅读:
    Mac 下安装Ant
    MAMP 10.10下启动报错解决方案
    [转]常用iOS图片处理方法
    Mac下Android SDK更新不了的解决办法
    细说23+1种设计模式
    mysql应该了解的知识点
    java快排思想
    简介一下 i++和++i&&i=i+i,i+=1;的区别
    对int类型的数据,如何让获取长度
    第一次写博客
  • 原文地址:https://www.cnblogs.com/stevenczp/p/5183304.html
Copyright © 2011-2022 走看看