虚拟机下的Ubuntu16.04+caffe+onlycup

官网的step很重要,要跟着官网,的步骤来:http://caffe.berkeleyvision.org/installation.html

然后对照:http://blog.csdn.net/firethelife/article/details/51926754

======================【关于注意和报错】===================

-------------------------------------------------------------------------------------

caffe下make 的时候遇到的一些找不到ldhf5之类的错误,则要安装libhdf5,如下解决:

sudo apt-get install libhdf5-dev

-------------------------------------------------------------------------------------

【http://www.linuxidc.com/Linux/2016-07/132860.htm】

首先安装必要的库,有的依赖库我是已经安装过的,具体安装的先后关系已经忘了。如果出现有些依赖关系不满足的错误,可以再安装库:

$ sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev    # 必要的基本库

根据上面的链接下载OpenCV3.1.0版本,并进行解压,解压之后进入安装文件目录:

$ cd opencv-3.1.0
$ mkdir build #创建build文件夹
$ cd opencv-3.1.0/build
$ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

----------------------------------------------------------------------------------

OpenBLAS:

The default directory is /opt/OpenBLAS     /*这个是默认安装路径*/

$ git clone https://github.com/xianyi/OpenBLAS.git

【http://www.linuxdiyf.com/linux/15610.html】

则需要安装,安装的步骤如下:

(1)git clone https://github.com/xianyi/OpenBLAS.git

(2)cd OpenBLAS

(3)make FC=gfortran (如果没有安装gfortran,执行sudo apt-get install gfortran)

(4) make install (将OpenBLAS安装到/opt下)

装好后,对应 caffe下Makefile.config修改如下:

# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
BLAS_INCLUDE := /opt/OpenBLAS/include
BLAS_LIB := /opt/OpenBLAS/lib

-----------------------------------------------------------------------------------

caffe,,,make 的时候会发生一些错误,查看caffe下Makefile.config,修改:

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/

其中:/usr/include/hdf5/serial/是hdf5的位置。

---------------------------------------------------------------------------------------

【http://blog.csdn.net/lanxuecc/article/details/51997919】

runtest时会报一个错::build_release/tools/caffe: error while loading shared libraries: libopenblas.so.0: cannot open shared object file: No such file or directory,解决方法:在/usr/lib/下建立一个 软链接将 libopenblas.so.0指向/openbls安装目录/lib/ libopenblas.so.0

-----\

在/usr/lib/下建立一个 软链接将 libopenblas.so.0指向/openbls安装目录/lib/ libopenblas.so.0
ln -s /opt/OpenBLAS/lib/libopenblas.so.0 /usr/lib/libopenblas.so.0

------------------------------------------------------------------------------------

============= 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
# 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 := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
BLAS_INCLUDE := /opt/OpenBLAS/include
BLAS_LIB := /opt/OpenBLAS/lib

# 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)/anaconda2
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 /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/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

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

-----------------------------------------------------------------------------------------------

感想:在Windows和虚拟机Ubuntu16下都搭好了环境了,好想大声喊一句:鬼知道我这四天经历了什么。。。。幸好你没有放弃!!!

花了2天的时间明白:cuda是英伟达的显卡,而我的机子是【计算机右键-属性-适配器-(最后一项)显示适配器:AMD】AMD的,所以装了cuda进不去Ubuntu的图形界面,在这里开启了各种重装的坎坷路程。。。。整整话了两天啊。。。我的妈呀!!!幸好,坚持了下来!!:)加油。

虚拟机Ubuntu16,caffe环境搭建的更多相关文章

  1. 基于VGGnet的人脸识别系统-ubuntu 系统下的Caffe环境搭建(CPU)

    对于caffe的系统一般使用linux系统,当然也有windows版本的caffe,不过如果你一开始使用了windows下面的caffe,后面学习的过程中,会经常遇到各种错误,网上下载的一些源码.模型 ...

  2. 从头来之【图解针对虚拟机iOS开发环境搭建】

    1.下载Mac OSX10.9. 点击下载 2.下载VMware Workstation 10,点击下载,网页中包含序列号.安装VM. 3.VM10-MacOS补丁.用于创建苹果虚拟机. 安装VM就不 ...

  3. 虚拟机IOS开发环境搭建教程

    来源:http://www.cnblogs.com/xiaoyaoju/archive/2013/05/21/3091171.html 安装条件: 硬件:一台拥有支持虚拟技术的64位双核处理器和2GB ...

  4. 从头来之【图解针对虚拟机iOS开发环境搭建】 (转)

    1.下载Mac OSX10.9. 点击下载 2.下载VMware Workstation 10,点击下载,网页中包含序列号.安装VM. 3.VM10-MacOS补丁.用于创建苹果虚拟机. 安装VM就不 ...

  5. 【神经网络与深度学习】Win10+VS2015 caffe环境搭建(极其详细)

    caffe是好用,可是配置其环境实在是太痛苦了,依赖的库很多不说,在VS上编译还各种报错,你能想象那种被一百多个红色提示所笼罩的恐惧.  且网上很多教程是VS2013环境下编译的,问人很多也说让我把1 ...

  6. Ubuntu16+pinpoint环境搭建

    最近研究了pinpoint,稍后放上环境搭建教程,建议想学习搭建的同学记得参考pinpointGitHub

  7. windows10下基于docker的bvlc/caffe环境搭建与使用

    docker 安装参见docker官网,当cmd出现以下图像时安装正确; 然后进行bvlc/caffe环境创建,有两种,一种是直接pull github的bvlc,一种是本地创建image,直接使用g ...

  8. 机器学习caffe环境搭建——redhat7.1和caffe的python接口编译

    相信看这篇文章的都知道caffe是干嘛的了,无非就是深度学习.神经网络.计算机视觉.人工智能这些,这个我就不多介绍了,下面说说我的安装过程即遇到的问题,当然还有解决方法. 说下我的环境:1>虚拟 ...

  9. VMware 安装centOS6.4虚拟机以及基础环境搭建

随机推荐

  1. DIV设置overflow无效的原因

    因为项目需求需要在一个div中添加多个checked 添加的时候使用了 <label><input type="checkbox" value="123 ...

  2. zookeeper学习系列:三、利用zookeeper做选举和锁

    之前只理解zk可以做命名,配置服务,现在学习下他怎么用作选举和锁,进一步还可构建master-slave模式的分布式系统. 为什么叫Zoo?“因为要协调的分布式系统是一个动物园”. ZooKeeper ...

  3. ros使用rplidar hector_mapping建地图

    ros中建地图方式有两种: 首先1.首先下载hector_slam包到你工作空间的src下 命令: cd ~/catkin/src git clone https://github.com/tu-da ...

  4. java 异常

    异常简介 java中有Error和Exception Error:是程序无法处理的错误,表示运行应用程序中较严重问题.大多数错误与代码编写者执行操作无关,而表示运行时JVM出现的问题. Excepti ...

  5. VMware Workstation 10.0.4.2249910 CN

    VMware Workstation 10.0.4.2249910.exe Workstation10.0.4修复了微软Windows 8.1和Windows Server 2012操作系统中的内存问 ...

  6. Python开发入门与实战9-基于vs的集成开发环境

    9. 基于visual studio的Python的集成开发环境 上一章我们描述了如何安装使用Java的集成开发环境Eclipse IDE,本章我们来说明另一种集成开发环境,也是笔者多年的开发习惯使用 ...

  7. iOS视图控制器的生命周期

    今天面试有一道面试题因为回答不好,因为也不经常涉及所以有点模糊,我选择了最保守的回答,没有展开写出我对这个问题的理解. 问题:IOS 开发 loadView 和 viewDidLoad 的区别? 经过 ...

  8. iOS webView 远程html加载本地资源

    昨天,一个朋友让我帮他在IOS上弄这样一件事情: webView 调用远程URL,并且让远程的web 通过自定义标签能实现内嵌本地的图片.js 或音频等. 比如:在服务器端 的html文件中 这样写到 ...

  9. Android平板电脑开发— — —碎片

    碎片是一种可以嵌入在活动中的UI片段,它能让程序更加合理与充分地使用大屏幕的空间,碎片通常都是在平板电脑开发中才会使用 简单实例 左碎片布局 <?xml version="1.0&qu ...

  10. 团队开发——冲刺1.e

    冲刺阶段一(第五天) 冲刺阶段一(第五天) 1.昨天做了什么?优化界面细节. 查看C#资料,再解决自己电脑的问题. 2.今天准备做什么? 为解决自己电脑的问题,查找关于C#的资料,后期做准备.