关于系统环境:

  • Ubuntu 16.04 LTS
  • cuda 8.0
  • cudnn 6.5
  • Anaconda3

编译pycaffe之前需要配置文件Makefile.config

  1. ## Refer to http://caffe.berkeleyvision.org/installation.html
  2. # Contributions simplifying and improving our build system are welcome!
  3.  
  4. # cuDNN acceleration switch (uncomment to build with cuDNN).
  5. USE_CUDNN :=
  6.  
  7. # CPU-only switch (uncomment to build without GPU support).
  8. # CPU_ONLY :=
  9.  
  10. # uncomment to disable IO dependencies and corresponding data layers
  11. # USE_OPENCV :=
  12. # USE_LEVELDB :=
  13. # USE_LMDB :=
  14.  
  15. # uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
  16. # You should not set this flag if you will be reading LMDBs with any
  17. # possibility of simultaneous read and write
  18. # ALLOW_LMDB_NOLOCK :=
  19.  
  20. # Uncomment if you're using OpenCV 3
  21. # OPENCV_VERSION :=
  22.  
  23. # To customize your choice of compiler, uncomment and set the following.
  24. # N.B. the default for Linux is g++ and the default for OSX is clang++
  25. # CUSTOM_CXX := g++
  26.  
  27. # CUDA directory contains bin/ and lib/ directories that we need.
  28. CUDA_DIR := /usr/local/cuda
  29. # On Ubuntu 14.04, if cuda tools are installed via
  30. # "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
  31. # CUDA_DIR := /usr
  32.  
  33. # CUDA architecture setting: going with all of them.
  34. # For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
  35. # For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
  36. CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
  37. -gencode arch=compute_20,code=sm_21 \
  38. -gencode arch=compute_30,code=sm_30 \
  39. -gencode arch=compute_35,code=sm_35 \
  40. -gencode arch=compute_50,code=sm_50 \
  41. -gencode arch=compute_52,code=sm_52 \
  42. -gencode arch=compute_60,code=sm_60 \
  43. -gencode arch=compute_61,code=sm_61 \
  44. -gencode arch=compute_61,code=compute_61
  45.  
  46. # BLAS choice:
  47. # atlas for ATLAS (default)
  48. # mkl for MKL
  49. # open for OpenBlas
  50. BLAS := atlas
  51. # Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
  52. # Leave commented to accept the defaults for your choice of BLAS
  53. # (which should work)!
  54. # BLAS_INCLUDE := /path/to/your/blas
  55. # BLAS_LIB := /path/to/your/blas
  56.  
  57. # Homebrew puts openblas in a directory that is not on the standard search path
  58. # BLAS_INCLUDE := $(shell brew --prefix openblas)/include
  59. # BLAS_LIB := $(shell brew --prefix openblas)/lib
  60.  
  61. # This is required only if you will compile the matlab interface.
  62. # MATLAB directory should contain the mex binary in /bin.
  63. # MATLAB_DIR := /usr/local
  64. # MATLAB_DIR := /Applications/MATLAB_R2012b.app
  65.  
  66. # NOTE: this is required only if you will compile the python interface.
  67. # We need to be able to find Python.h and numpy/arrayobject.h.
  68. # PYTHON_INCLUDE := /usr/include/python2. \
  69. # /usr/lib/python2./dist-packages/numpy/core/include
  70. # Anaconda Python distribution is quite popular. Include path:
  71. # Verify anaconda location, sometimes it's in root.
  72. ANACONDA_HOME := /home/ipc/anaconda3
  73. # PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
  74. # $(ANACONDA_HOME)/include/python3.6m \
  75. # $(ANACONDA_HOME)/lib/python3./site-packages/numpy/core/include
  76. # 关键点1:根据自己的情况设置好ANACONDA的路径
  77. # Uncomment to use Python (default is Python )
  78. PYTHON_LIBRARIES := boost_python3 python3.6m
  79. PYTHON_INCLUDE := $(ANACONDA_HOME)/include $(ANACONDA_HOME)/include/python3.6m $(ANACONDA_HOME)/lib/python3./site-packages/numpy/core/include
  80. # 关键点2:需要注意其中的版本号,原始文件是3.5的,但是我的anaconda是3.6的,因此如果直接uncomment,就会出现问题,需要根据自己的情况设置好
  81. # We need to be able to find libpythonX.X.so or .dylib.
  82. # PYTHON_LIB := /usr/lib
  83. PYTHON_LIB := $(ANACONDA_HOME)/lib
  84.  
  85. # Homebrew installs numpy in a non standard path (keg only)
  86. # PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
  87. # PYTHON_LIB += $(shell brew --prefix numpy)/lib
  88.  
  89. # Uncomment to support layers written in Python (will link against Python libs)
  90. WITH_PYTHON_LAYER :=
  91.  
  92. # Whatever else you find you need goes here.
  93. INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/lib/x86_64-linux-gnu/hdf5/serial/include /usr/local/cuda/include
  94. LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial /usr/local/cuda/lib64
  95.  
  96. # If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
  97. # INCLUDE_DIRS += $(shell brew --prefix)/include
  98. # LIBRARY_DIRS += $(shell brew --prefix)/lib
  99.  
  100. # NCCL acceleration switch (uncomment to build with NCCL)
  101. # https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
  102. # USE_NCCL :=
  103.  
  104. # Uncomment to use `pkg-config` to specify OpenCV library paths.
  105. # (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
  106. # USE_PKG_CONFIG :=
  107.  
  108. # N.B. both build and distribute dirs are cleared on `make clean`
  109. BUILD_DIR := build
  110. DISTRIBUTE_DIR := distribute
  111.  
  112. # Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
  113. # DEBUG :=
  114.  
  115. # The ID of the GPU that 'make runtest' will use to run unit tests.
  116. TEST_GPUID :=
  117.  
  118. # enable pretty build (comment to see full commands)
  119. Q ?= @
  1. 如上方式配置文件Makefile.config(路径问题)

    • 可避免Python.h 和 numpy/arrayobject.h文件找不到的问题
  2. cannot find -lboost_python3的问题(版本问题)(参考 http://blog.csdn.net/u012675539/article/details/51351553)
    • 检查是否有文件存在:ls /usr/lib/x86_64-linux-gnu/libboost_python-py35.so
    • 建立软链接:sudo ln -s libboost_python-py35.so libboost_python3.so
  3. libstdc++.so.6: version 'GLIBCXX_3.4.20' not found的问题 (版本问题)
    • conda install libgcc(conda不能也无需使用sudo)
  4. No module named 'google'的问题 (版本问题)
    • conda install protobuf
  5. 以sudo用户(如sudoxxx)进行安装,其他用户(如otherxxx)进行运行
    • sudo chown otherxxx caffe(权限问题)
    • .bashrc修改环境变量:最后面加入export PYTHONPATH=(你的caffe/python路径,如/home/otherxxx/caffe/python):$PYTHONPATH

上述即为在安装pycaffe过程中所踩过的坑!

安装python caffe过程中遇到的一些问题以及对应的解决方案的更多相关文章

  1. centos7安装Python3的过程中会和Python2.7版本冲突导致yum版本比对应,致使yum不能使用的问题。

    centos7安装Python3的过程中会和Python2.7版本冲突导致yum版本比对应,致使yum不能使用的问题. 原因:yum调用Python,启动程/usr/bin/yum就是一个python ...

  2. 在学习python的过程中,遇到的最大的困难是什么?

    本人文科生,回顾自己近 2 年的Python 自学经历,有一些学习心得和避坑经验分享给大家,让大家在学习 Python 的过程中少走一些弯路!减少遇到不必要的学习困难! 首先,最开始最大的困难应该就是 ...

  3. (转)CloudStack 安装及使用过程中常见问题汇总

    CloudStack 安装及使用过程中常见问题汇总             在做工程项目中对CloudStack 安装及使用过程中常见的几个问题及如何解决做一个总结.   1.Windows XP虚拟 ...

  4. MySQL安装过程中对The error code is 2203的解决方案

    MySQL安装过程中对The error code is 2203的解决方案 1.问题描述 Windows系统安装MySQL遇到The error code is 2203.,具体描述如下 The i ...

  5. VS·调试过程中某个操作导致调试突然退出之解决方案

    阅文时长 | 0.11分钟 字数统计 | 232字符 主要内容 | 1.引言&背景 2.声明与参考资料 『VS·调试过程中某个操作导致调试突然退出之解决方案』 编写人 | SCscHero 编 ...

  6. Windows安装部署Tensorflow过程中的问题处理

    1 在配置Tensorflow过程中有一行命令是 python object_detection/builders/model_builder_test.py 过程中出现了 NameError: na ...

  7. python 笔记1:安装python;eclipse中安装配置pydev

    1  下载安装python. 官网:https://www.python.org/downloads/     根据自己的操作系统选择需要的版本下载并安装. 我的电脑操作系统windows xp的,只 ...

  8. Office2007在安装、卸载过程中出错的解决办法

    Micorsoft office professional plus 2007在安装过程中出错,错误1706 如果在安装OFFICE 2007的 时候,遇到“Microsoft Office 2007 ...

  9. Python 爬虫过程中的中文乱码问题

    python+mongodb 在爬虫的过程中,抓到一个中文字段,encode和decode都无法正确显示 注:以下print均是在mongodb中截图显示的,在pythonshell中可能会有所不同 ...

随机推荐

  1. bug优先级别

    https://www.cnblogs.com/evablogs/p/6785083.html bug缺陷的优先级别 首先需要对一个版本进行冒烟测试,确定基本功能测试,如果不通过的话进行后期的测试已经 ...

  2. 【原】Java学习笔记016 - 面向对象

    package cn.temptation; public class Sample01 { public static void main(String[] args) { // this 关键字 ...

  3. Linix基本命令

    基本命令关机:shutdown -h halt init 0 poweroff重启:shutdown -r reboot init 6pwd:查看工作目录ls:查看指定目录的内容-l:列表显示-a:显 ...

  4. PHP实现表单提交发送邮件

    只需要三个文件就可以了: 注意: 文件自命名需修改表单提交url,包含的类文件名: HTML表单文件: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ...

  5. android菜鸟,了解android工程目录结构

  6. 爬虫系列----scrapy爬取网页初始

    一 基本流程 创建工程,工程名称为(cmd):firstblood: scrapy startproject firstblood 进入工程目录中(cmd):cd :./firstblood 创建爬虫 ...

  7. 【Python 20】BMR计算器4.0(异常处理)

    1.案例描述 基础代谢率(BMR):我们安静状态下(通常为静卧状态)消耗的最低热量,人的其他活动都建立在这个基础上. 计算公式: BMR(男) = (13.7*体重kg)+(5.0*身高cm)-(6. ...

  8. KindEditor富文本编辑器使用

    我的博客本来打算使用layui的富文本编辑器,但是出了一个问题,无法获取编辑器内容,我参考官方文档,获取内容也就那几个方法而已,但是引入进去后始终获取的值为空,百度和bing都试过了,但是始终还是获取 ...

  9. 网络安全实验室--SQL注入关

    第一关 万能密码:username='or '1'='1'#    password=1    即可登录得到flag. 第二关 最基础的注入,order by 判断字段数,然后 union selec ...

  10. C# PDF转Image图片

    概述 PDF是常用的文件格式之一,通常情况下,我们可以使用itextsharp生产PDF文件:可是如何将PDF文件转换成图片那?目前常用的: 思路1.根据PDF绘画轨迹重新绘制图片: 思路2.是将PD ...