zoukankan      html  css  js  c++  java
  • ubuntu 下 caffe 的安装

    官方下载说明:Caffe | Installation: Ubuntu

    在 ubuntu 的一些较新版本中(14.04 以上),caffe 的所有依赖包都可以使用 apt-get 大法搞定。

    1. 依赖项的安装

    如果没有使用 root 账号,则每个命令前需要加 sudo

    • sudo apt-get install git
    • 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
    • sudo apt-get install libatlas-base-dev
    • sudo apt-get install python-dev
    • sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

    2. 使用 git 下载 caffe 源码

    $ git clone https://github.com/bvlc/caffe.git
    $ cd caffe/
    $ mv Makefile.config.example Makefile.config

    3. 编译

    GPU 的配置稍显麻烦,以后给出,这里我们仅将环境设为 CPU_ONLY,具体做法修改 Makefile.config,打开 CPU_ONLY 选项即可。

    $ make -j

    4. 编译时可能发生的错误及解决方案

    • ./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory

      • 修改 Makefile.config 的 INCLUDE_DIRS 选项,也即增加 /usr/include/hdf5/serial目录;
      • 修改 Makefile 文件的 LIBRARIES 选项,将末尾的:
        • hdf5_hl 修改为 hdf5_serial_hl
        • hdf5 修改为 hdf5_serial
    • g++: internal compiler error: Killed (program cc1plus)

  • 相关阅读:
    C# 根据年月日获取星期几方法
    C# 程序实现功能目录
    json字符串转泛型集合对象
    mongoDB基本操作
    Mac下安装mongoDB
    Mac下安装redis
    Mac下安装Scrapy
    beautiful Soup实现抓取图片素材
    python os模块常用方法
    转载---关于Spring的69个面试问答
  • 原文地址:https://www.cnblogs.com/mtcnn/p/9422167.html
Copyright © 2011-2022 走看看