CentOS6.4下编译caffe深度学习框架实践!!!

花了点时间在CentOS6.4服务器上搭建caffe深度学习框架环境其中遇到了一些问题,最终还是解决.

先上图看看:



应该很直观了吧,其中细节注意:

1. 在编译ATLAS时出现CPU频率问题,我就直接使用yum源:yum install atlas-devel blas-devel

2. 在链接gflags时,报-fPIC相关,CMakeLists.txt中set (CMAKE_CXX_FLAGS " -fPIC")不管用,我是去修改gflags/build/CMakeFiles/gflags_static.dir/flags.make中的CXX_FLAGS,添加-fPIC:

# compile CXX with /usr/bin/c++
CXX_FLAGS = -fPIC -O3 -DNDEBUG -I/root/AI/gflags/build/include -I/root/AI/gflags/src -I/root/AI/gflags/build/include/gflags

其他雷同.

3. 编译boost库

cd boost_1_59_0

./bootstrap.sh

./bjam stage --stagedir=x64 --with-python --with-regex --with-date_time --with-timer --with-atomic --with-thread --with-filesystem --with-system

编译完后,拷贝boost到/usr/local/include以及libboost*到/usr/local/lib


编译caffe:

tar xzfcaffe-rc3.tar.gz

cdcaffe-rc3

cpMakefile.config.exampleMakefile.config

修改对应配置

make


贴一下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
# 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 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_50,code=compute_50

# 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 := /usr/lib64/atlas

# 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 := /usr/include/python2.7 \
		/usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location,sometimes it's in root.
# ANACONDA_HOME := $(HOME)/anaconda
# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
		# $(ANACONDA_HOME)/include/python2.7 \
		# $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \

# Uncomment to use Python 3 (default is Python 2)
# PYTHON_LIBRARIES := boost_python3 python3.5m
# 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 /root/AI/hdf5-1.8.17/hdf5/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /root/AI/hdf5-1.8.17/hdf5/lib

# 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

# 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

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 ?= @

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


#使用军哥的lnmp配置虚拟主机,需要注意的是要配置hosts文件(这一点官方没有讲到)具体方法:1、修改hosts文件sudo vim /etc/hosts2、在hosts文件中新增一行(这里类似于windows上配置hosts文件)127.0.0.1 www.baidu.com3、保存并重启网络
一、配置编译环境 yum update &amp;&amp; yum upgrade yum groupinstall &quot;Development Tools&quot; yum install gcc gcc-c++ pcre* openssl* gd-devel* zlib-devel
一、下载repo文件 二、备份并替换系统的repo文件 三、执行yum源更新操作
LAMP -- Linux Apache MySQL PHP 在CentOS安装的顺序,我一般是Apache&#160;-&gt;&#160;MySQL&#160;-&gt;&#160;PHP 第一步、安装并配置Apache 1、使用yum安装 [plain]&#160;view plaincopy
一、下载nginx安装包,官网下载中心http://nginx.org/download [root@localhost software]# wget http://nginx.org/download/nginx-1.10.1.tar.gz 二、解压nginx安装包 [root@localhos
1.下载composer curl -sS https://getcomposer.org/installer | php ps:如果出现php无法运行的情况,请先把PHP加入环境变量,具体操作参考《centOS安装PHP》 2.移动或复制composer到环境下可执行 cp composer.ph
一、卸载旧版本的vim 二、安装终端字符处理库ncurses 三、下载Vim8 四、编译安装 五、添加到系统环境变量 六、安装成功
引言 我们在日常的开发过程中,很多时候需要连接服务器查看日志或者在服务器上调试代码。但是,使用 ssh 命令登录服务器每次都需要输出密码,就比较繁琐。因此我们可以使用 sshpass 通过参数指定密码进行登录。解决了这个问题之后,我发现登录服务器之后,还需要手动 cd 切换到项目目录或者日志目录。为
iptables basics Introduction iptables 是一个配置 Linux 防火墙的工具,是 netfilter 项目的一部分。 在 Linux Kernel 3.13 及以上版本中, nftables 将作为后继者取代 iptables 以成为更强大易用的防火墙工具 Bas
一、下载tengine 二、安装tenginx(nginx)的模块依赖库 三、解压并指定安装路径 四、编译安装 五、启动(tengine)nginx 六、访问(tengine)nginx
这篇文章介绍了如何快速部署一套Kubernetes集群,下面就快速开始吧! 准备工作 机器部署规划 主机 | IP | 部署组件 | | master主节点 | 192.168.199.206 | etcd、kube apiserver、kube controller manager、kube sc
一、pip下载 二、解压安装 三、安装完成
1、WebBench安装: yum install ctags(先安装依赖库) mkdir /usr/local/man (创建一个目录不然会报错) wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz tar zxv
1:查看环境: [root@10-4-14-168 html]# cat /etc/redhat-release CentOS release 6.5 (Final) 2:关掉防火墙 [root@10-4-14-168 html]# chkconfig iptables off 3:配置CentOS
安装 1.检查当前是否有安装php rpm&#160;-qa|grep&#160;php 如果有安装PHP,那么请先删除这些安装包: yum&#160;remove&#160;php* 2.安装php源 Centos 5 安装php源: rpm&#160;-ivh&#160;http://mirro
一、安装 二、配置 三、修改配置文件 四、program 配置 五、启动
Sed 日常使用介绍 简介 是 环境下常用的流处理工具, 可以处理字符流, 文件或者二进制文件流。 各个 发行版都会配备 及其衍生的命令工具, 因此, 掌握该工具的基本用法, 足以满足我们日常的许多文本处理的任务。 以下采用示例的方式对 进行基本用法介绍. 如果有兴趣了解更高级的使用技巧, 本文采用
linux下开机自启: 在/etc/init.d目录下新建文件elasticsearch 并敲入shell脚本: 注意, 前两行必须填写,且要注释掉。 第一行为shell前行代码,目的告诉系统使用shell。 第二行分别代表运行级别、启动优先权、关闭优先权,且后面添加开机服务会用到。 shell脚本
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以需要赋予其可执行权 chmod +x /etc/rc.d/rc.local 2、赋予脚本可执行权限假设/usr/local/script/autostart.sh是你的脚本路径,给予执行权限 chmod +x /usr
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用ls -ll,会显示成字节大小,而ls- lh会以KB、MB等为单位进行显示,这样比较直观一些。 通过命令du -h –max-depth=1 *,可以查看当前目录下各文件、文件夹的大小,这个比较实用。 查询当前目录总大小可以使用d