ubuntu 编译caffe makefile.config
这个是我以前总结的:
首先先用cmake把caffe安装好,这里就省略了这一步。
然后:
sudo apt-get update
sudo apt-get install python-pip python-dev python-numpy
sudo apt-get install gfortran graphviz
sudo apt-get install python-numpy python-scipy python-matplotlib python-sklearn python-skimage python-h5py python-protobuf python-leveldb python-networkx python-nose python-pandas python-gflags Cython ipython
sudo apt-get install protobuf-c-compiler protobuf-compiler
sudo pip install pydot
sudo pip install -r ${CAFFE_ROOT}/python/requirements.txt
安装过程中可能会遇到一些问题,比如要求numpy>X.X(版本号),python-gflags>X.X(版本号),就是一些包的版本太低了。可以把/tmp/pip_build_root/ 目录下对应的文件删除掉,比如sudo rm -rf numpy,然后sudo pip install numpy --upgrade。
然后sudo vim /etc/profile
存入自己的python路径
export PYTHONPATH=~/caffe/python:$PYTHONPATH
source /etc/profile
最后执行python
import caffe
如果成功了就恭喜
如果没成功就根据提醒再解决问题
makefile.config:
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
# USE_OPENCV := 0
# USE_LEVELDB := 0
# USE_LMDB := 0
# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
# You should not set this flag if you will be reading LMDBs with any
# possibility of simultaneous read and write
# ALLOW_LMDB_NOLOCK := 1
# Uncomment if you're using OpenCV 3
# OPENCV_VERSION := 3
# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda-8.0
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr
# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_52,code=sm_52 \
-gencode arch=compute_60,code=sm_60 \
-gencode arch=compute_61,code=sm_61 \
-gencode arch=compute_61,code=compute_61
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := atlas
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas
# Homebrew puts openblas in a directory that is not on the standard search path
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
# BLAS_LIB := $(shell brew --prefix openblas)/lib
# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
# MATLAB_DIR := /usr/local
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /home/lbg/anaconda3/include/python3.6m \
/home/lbg/anaconda3/lib/python3.6/site-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
ANACONDA_HOME := /home/lbg/anaconda3
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
$(ANACONDA_HOME)/include/python3.6m \
$(ANACONDA_HOME)/lib/python3.6/site-packages/numpy/core/include
# Uncomment to use Python 3 (default is Python 2)
PYTHON_LIBRARIES := boost_python-py35 python3.6m
# PYTHON_INCLUDE := /usr/include/python3.5m \
# /usr/lib/python3.5/dist-packages/numpy/core/include
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib
# Homebrew installs numpy in a non standard path (keg only)
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
# PYTHON_LIB += $(shell brew --prefix numpy)/lib
# Uncomment to support layers written in Python (will link against Python libs)
WITH_PYTHON_LAYER := 1
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/cuda-8.0/include /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/cuda-8.0/lib /usr/lib/x86_64-linux-gnu/hdf5/serial
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
# INCLUDE_DIRS += $(shell brew --prefix)/include
# LIBRARY_DIRS += $(shell brew --prefix)/lib
# NCCL acceleration switch (uncomment to build with NCCL)
# https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
# USE_NCCL := 1
# Uncomment to use `pkg-config` to specify OpenCV library paths.
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
# USE_PKG_CONFIG := 1
# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1
# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0
# enable pretty build (comment to see full commands)
Q ?= @
首先先用cmake把caffe安装好,这里就省略了这一步。
然后:
sudo apt-get update
sudo apt-get install python-pip python-dev python-numpy
sudo apt-get install gfortran graphviz
sudo apt-get install python-numpy python-scipy python-matplotlib python-sklearn python-skimage python-h5py python-protobuf python-leveldb python-networkx python-nose python-pandas python-gflags Cython ipython
sudo apt-get install protobuf-c-compiler protobuf-compiler
sudo pip install pydot
sudo pip install -r ${CAFFE_ROOT}/python/requirements.txt
安装过程中可能会遇到一些问题,比如要求numpy>X.X(版本号),python-gflags>X.X(版本号),就是一些包的版本太低了。可以把/tmp/pip_build_root/ 目录下对应的文件删除掉,比如sudo rm -rf numpy,然后sudo pip install numpy --upgrade。
然后sudo vim /etc/profile
存入自己的python路径
export PYTHONPATH=~/caffe/python:$PYTHONPATH
source /etc/profile
最后执行python
import caffe
如果成功了就恭喜
如果没成功就根据提醒再解决问题
ubuntu 编译caffe makefile.config相关推荐
- ubuntu14.04下安装cudnn5.1.3,opencv3.0,编译caffe及配置matlab和python接口过程记录
已有条件: ubuntu14.04+cuda7.5+anaconda2(即python2.7)+matlabR2014a 上述已经装好了,开始搭建caffe环境. 1. 装cudnn5.1.3,参照: ...
- ubuntu下caffe 安装记录(含GPU)
第一步安装相关依赖项 第二步安装驱动 第三步安装CUDA80 第四步cuDNN 第五步 安装OpenCV30 第六步 安装caffe 上周安装环境,遇到各种问题,重装系统共计四次!记录一下安装过程,方 ...
- caffe cmake matlab,编译caffe时候抛出的错误
编译caffe时候抛出的错误 我在安装ubuntu14.04上安装了cuda7.5,cudnn4.0等,使用起来都挺好的,没什么问题,最近,把21天实战caffe上面第五天的以来库都装完之后,准备装m ...
- (原)Ubuntu16中编译caffe
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5797526.html 参考网址: http://caffe.berkeleyvision.org/in ...
- Ubuntu编译内核及grub的一些笔记
最近心态不稳定,不怎么想发表文章,但看了看之前写了的笔记,想想还是整理出来吧,其实我写文章,也有一部分原因是为了心里的慰藉--当年游戏打不过别人,关注点便转向其它方面.这里整理的是以前编译内核.引导启 ...
- matlab openblas,ubuntu上Caffe使用OpenBLAS多线程加速
一些概念 使用Caffe的模型做分类时,其运算大概是这样:把输入的图像当做矩阵,一直不停的和模型里面的卷积层kernel做卷积,然后推给pooling层做缩放,最后得到分类结果.最耗时的部分应该在于卷 ...
- ubuntu16.04 matlab2017b 编译caffe的matlab接口 吐血经历 解决几乎所有make mattest问题
原本只用编译好的caffe来finetune,不需配置接口,两天就配好了 然而为了中间层输出,要配置matlab接口,花了一个星期才搞定. 服务器的版本情况是: ubuntu16.04 cuda8.0 ...
- 编译linux内核分区,Ubuntu编译内核及grub的一些笔记
最近心态不稳定,不怎么想发表文章,但看了看之前写了的笔记,想想还是整理出来吧,其实我写文章,也有一部分原因是为了心里的慰藉--当年游戏打不过别人,关注点便转向其它方面.这里整理的是以前编译内核.引导启 ...
- extras mibs php7,ubuntu编译安装php7遇到的问题及解决方案
configure: error: Cannot find OpenSSL's 这个可以在configure的时候,指定openssl的路径,查看openssl的安装路径: root@ubuntu: ...
最新文章
- java 汉字 数字_java数字转汉字工具类详解
- 【IBM Tivoli Identity Manager 学习文档】11 TIM设计思路介绍
- 1.8 简单的文件输入输出
- Spring Cloud学习笔记-010
- ML:根据不同机器学习模型输出的预测值+且与真实值相减得到绝对误差对比+误差可视化
- 如何产生QPSK信号
- [剑指offer]面试题第[37]题[Leedcode][JAVA][第297题][二叉树列的序列化与反序列化][递归][BFS]
- List列表拒绝添加重复信息
- POJ NOI MATH-7826 分苹果
- Qt之Threads和QObjects
- python从键盘获取列表,python – 从5行中的列表列表中获取所有元素
- 工作流集成表单的过程
- mine 规范_2016国家最新设计及验收标准名称汇编GB
- 导出包含富文本内容和图片的word和pdf
- Jetson nano使用-- ROS安装记录
- 内网穿透(详细且免费)部署
- python矩阵变成图片_Python图片转换成矩阵,矩阵数据转换成图片
- JAVA算法:给定两个整数 n 和 k,返回 1 ... n 中所有可能的 k 个数的组合(JAVA)
- 07_02Redis
- Hi3516A 烧录内核后无法ping通网关和自己
热门文章
- java 课程设计 计算器_JAVA课程设计-计算器(201521123028 李家俊)
- git如何回退到之前版本
- 做自适应网站专业乐云seo_乐云分享新站SEO优化实践经验,收录和排名持续稳定上升方...
- 批处理 操作mysql_超简单使用批处理(batch)操作数据库
- mapreduce工作流程_详解MapReduce中的五大编程模型
- php umount强制,linux mount挂载与umount 卸载及“Device is busy”问题 | 璞玉(POOY)
- 一个接口是如何在Keycloak和Spring Security之间执行的
- 淘宝开源的代码质量检测工具!
- 每日一皮:你有没有过 Bug 变 Feature 的高光时刻?
- 每日一皮:你不看我的接口文档就乱调的吗?