服务器上安装caffe的过程记录
1. 前言
因为新的实验室东西都是新的,所以在服务器上要自己重新配置CAFFE
这里假设所有依赖包学长们都安装好了,我是没有sudo权限的
服务器的配置:
CUDA 8.0
Ubuntu 16.04 LTS
Tesla K80
2. 安装Caffe
先从GITHUB上CLONE下CAFFE的安装包
git clone https://github.com/BVLC/caffe.git
复制编译配置文件:
cp Makefile.configure.example Makefile.configure
然后按照 http://caffe.berkeleyvision.org/installation.html#compilation 的指示:
- For CPU & GPU accelerated Caffe, no changes are needed.
- For cuDNN acceleration using NVIDIA’s proprietary cuDNN software, uncomment the
USE_CUDNN := 1switch inMakefile.config. cuDNN is sometimes but not always faster than Caffe’s GPU acceleration.- For CPU-only Caffe, uncomment
CPU_ONLY := 1inMakefile.config.To compile the Python and MATLAB wrappers do
make pycaffeandmake matcafferespectively. Be sure to set your MATLAB and Python paths inMakefile.configfirst!
注释掉Makefile中相应行以适应自己的环境:
vi Makefile.configure
然后编译:
make all
make test
make runtest
如果想提高编译速度,可以使用:
make all -j16
make test -j16
make runtest -j16
原因参考:
Speed: for a faster build, compile in parallel by doing
make all -j8where 8 is the number of parallel threads for compilation (a good choice for the number of threads is the number of cores in your machine).
3. 编译过程中的问题与解决方法
在编译过程中如果遇到hdf5问题,参考如下:[1]
在make all这一步遇到了一些问题,首先是找不到hdf5.h,在Makefile.config中INCLUDE_DIRS后添加/usr/include/hdf5/serial即可继续编译。
src/caffe/layers/hdf5_data_layer.cpp:13:18: fatal error: hdf5.h: No such file or directory
但是此后又出现如下问题,
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
可以在LIBRARY_DIRS后添加/usr/lib/x86_64-linux-gnu/hdf5/serial/,最终Makefile.config文件对应部分修改如下,
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/
以上的操作保证Caffe编译过程中可以找到hdf5的头文件和共享库文件。
hdf5问题解决后,运行make test -j16
然后遇到很多人都会遇到的问题:
ffe.so.1.0.*** Aborted at (unix time) try "date -d @1502862874" if you are using GNU date ***
PC: @ 0x7f9fd538c428 gsignal
*** SIGABRT (@0x42700005a63) received by PID (TID 0x7f9fdf310780) from PID ; stack trace: ***
@ 0x7f9fd57313e0 (unknown)
@ 0x7f9fd538c428 gsignal
@ 0x7f9fd538e02a abort
@ 0x7f9fd53ce7ea (unknown)
@ 0x7f9fd53d6e0a (unknown)
@ 0x7f9fd53da98c cfree
@ 0x6fa00b caffe::LayerFactoryTest_TestCreateLayer_Test<>::TestBody()
@ 0x9785b3 testing::internal::HandleExceptionsInMethodIfSupported<>()
@ 0x971bca testing::Test::Run()
@ 0x971d18 testing::TestInfo::Run()
@ 0x971df5 testing::TestCase::Run()
@ 0x9730cf testing::internal::UnitTestImpl::RunAllTests()
@ 0x9733f3 testing::UnitTest::Run()
@ 0x4c5b4d main
@ 0x7f9fd5377830 __libc_start_main
@ 0x4cd8d9 _start
@ 0x0 (unknown)
Makefile:: recipe for target 'runtest' failed
找了很久也没找到适合的解决方法,但是学长说RUN TEST不通过也可以正常运行程序,好吧那就先这样,接下来
4. PYTHON接口
编译了PYTHON:
make pycaffe -j16
然后到此结束,下面是训练一下MNIST网络看看CAFFE能不能用:(注意目前是在CAFFE主文件夹下)
sh data/mnist/get_mnist.sh sh examples/mnist/create_mnist.sh sh examples/mnist/train_lenet.sh
等3分钟就会结束

准确率为99.08%
5. Matlab接口
如果要编译Matlab的Caffe接口,需要首先在Makefile.config中修改MATLAB的路径使得路径下有/bin
具体来说,如下图中可以看到当前目录下有/bin文件夹,

所以,在Makefile.configure中,Matlab的路径应该填写为
/opt/MATLAB/R2014b
然后运行
make matcaffe
以编译。
编译成功后如图:

再运行
make mattest
来检查编译是否成功
检查成功后如图:

如果找不到你自己的Matlab安装路径,可以使用:
find / -name matlab
然后就可以找到所有有Matlab名字的文件其所在位置
参考文献:
[1] http://blog.csdn.net/lkj345/article/details/51280369
[2] http://blog.csdn.net/solomon1558/article/details/52015754
[3] http://www.it610.com/article/4919314.htm
服务器上安装caffe的过程记录的更多相关文章
- 我在Suse 11 Sp3上使用anaconda安装TensorFlow的过程记录
我在Suse 11 Sp3上使用anaconda安装TensorFlow的过程记录 准备安装包: gcc48 glibc--SP4-DVD-x86_64-GM-DVD1.iso tensorflow_ ...
- 【记录】在MAC上安装caffe
---恢复内容开始--- 最近尝试在MAC(OS X 10.11 El Capitan)上安装Caffe 以及Python接口遇到了一些问题但是官方安装教程上并没有提出这些问题的解决办法搜索了很久(主 ...
- 在阿里云Linux服务器上安装MySQL
申请阿里云Linux服务器 昨天在阿里云申请了一个免费试用5天的Linux云服务器. 操作系统:Red Hat Enterprise Linux Server 5.4 64位. CPU:1核 内存:5 ...
- 在windows10上安装caffe和tensorflow
最近在Windows10上安装了caffe和tensorflow,折腾了好久.在此记录一下. 安装caffe的过程已在另一篇博客中进行了记录,在此不再赘述.而tensorflow也是非常简单的,也不再 ...
- 在一台Linux服务器上安装多个MySQL实例(一)--使用mysqld_multi方式
(一)MySQL多实例概述 实例是进程与内存的一个概述,所谓MySQL多实例,就是在服务器上启动多个相同的MySQL进程,运行在不同的端口(如3306,3307,3308),通过不同的端口对外提供服务 ...
- 我为什么很烦在DB服务器上安装杀毒软件
常见的数据库连接问题无外乎是在数据库服务器本地可以连接SQL Server,但通过其他服务器就不可以连接.但这次我却碰到了相反的情况,在服务器本地无法通过IP/实例名连接,但从其他服务器却可以.而且每 ...
- 线上服务器上安装的VNCServer不能正常工作
1.问题描述: 线上服务器上安装的不能正常工作 2.解决问题过程: 一. 重启vncserver 运行命令:vncserver -kill :1和vncserver :1 二. 发现vncserver ...
- 极简】如何在服务器上安装SSL证书?
本文适合任何人了解,图形化操作.下面以腾讯云为例,并且服务器(linux)也安装了宝塔面板. 1.登陆腾讯云账号进入控制台,找到SSL的产品 2.按要求申请并填写表单,记住私钥密码 3.提交后,待腾讯 ...
- 服务器上安装FileZilla Server连接时报You appear to be behind a NAT router. Please configure the passive mode settings and forward a range of ports in your router.
官方资源下载链接:客户端,或者直接点击下载“FileZilla_3.24.0_win64-setup.exe”:服务端,或者直接点击下载“FileZilla_Server-0_9_60_2.exe”: ...
随机推荐
- 2015-09-16 html课程总结1
HTML (HyperText Makeup Language)是超文本标记语言. 1.HTML结构 <html> <head> <title>标题</tit ...
- Mysql for Linux安装配置之—— 源码安装
1.安装 --假设已经有mysql-5.5.10.tar.gz以及cmake-2.8.4.tar.gz两个源码压缩文件1)先安装cmake(mysql5.5以后是通过cmake来编译的) # ta ...
- IIS隐藏版本号教程(Windows Server 2003)
1.下载Urlscan https://www.microsoft.com/en-us/search/DownloadResults.aspx?q=URLScan(总下载页面) https://dow ...
- office install problems
regedit 0000 "00005"或"00002"开头的项 remove all regedit options
- Zabbix3.4.7监控windows进程
1.首先,找到要监控进程的主机 创建新的监控项 然后应用集选择processes,点击添加,此处是以zabbix_agentd.exe为例添加 2. 为此监控项添加触发器 注意触发器表达式的编写,上面 ...
- react router @4 和 vue路由 详解(五)react怎么通过路由传参
完整版:https://www.cnblogs.com/yangyangxxb/p/10066650.html 7.react怎么通过路由传参? a.通配符传参(刷新页面数据不丢失) //在定义路由的 ...
- ssd物体检测模型训练和测试总结
参考网址:github:https://github.com/naisy/realtime_object_detection 2018.10.16ssd物体检测总结:切记粗略地看一遍备注就开始训练模型 ...
- 2.BIND服务基础及域主服务器配置
一.BIND 现今使用最晚广泛的DNS服务器软件是BIND(Berkeley Internet Name Domain),最早由伯克利大学的一名学生编写,现在最新的版本是9,由ISC(Internet ...
- IDEA使用GitHub托管代码
该方法基本也适用于JetBrains公司的其他IDE产品,如phpStorm,PyCharm等. 首先,在github官网注册一个账号,参考:http://stormzhang.com/github/ ...
- VSTO杂项拾零(持续更新中……)
环境:win 7+visual basic 2008 侧重:VSTO 界面:sheetbook工作簿 1.创建一个过程并调用(2017.6.3) Public Class Sheet1 ...