linux服务器下基于caffe的flownet搭建
来源:互联网 发布:通达信手机炒股软件 编辑:程序博客网 时间:2024/06/02 03:15
之前没有用过Linux系统,也没有用过Linux版的caffe,一头雾水,装了两天,第一天各种错误各种晕乎,连sudo、vim怎么用都是现百度的……
第二天忽然开窍了就装好了……我也不知道怎么弄好的。
Linux的权限不太懂,反正每个命令前都要加sudo
sudo vim才可以更改文件。
一、依赖库
sudo apt-get install libatlas-base-dev sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler
官网上有的,但是大多教程上没有的,不知道有没有用,还是装了吧……
# glogwget https://github.com/google/glog/archive/v0.3.3.tar.gztar zxvf v0.3.3.tar.gzcd glog-0.3.3./configuremake && make install# gflagswget https://github.com/schuhschuh/gflags/archive/master.zipunzip master.zipcd gflags-mastermkdir build && cd buildexport CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1make && make install# lmdbgit clone https://github.com/LMDB/lmdbcd lmdb/libraries/liblmdbmake && make install
二、下载caffe或者hed、flownet等基于caffe的框架sudo git clone 复制网址在此处
cd 刚下载的文件夹处
三、修改makefile.config
sudo cp MakeFile.config.example MakeFile.congigsudo vim MakeFlie.config根据自己的情况
用CPU还是gpu,要改
用Python借口,用的是Python还是anaconda的Python,要根据自己的情况改一下注释
用MATLAB借口,我没有用
vim 退出保存:x!
退出不保存:q!
上面两条有冒号!!!
四、 编译
1.
sudo make all
出现错误
Makefile:572: recipe for target '.build_release/src/caffe/util/hdf5.o' failed
参考 http://blog.csdn.net/forest_world/article/details/51371560
修改Makefile.config
INCLUDE_DIRS
/usr/include/hdf5/serial/
修改Makefile
LIBRARIES
hdf5_hl and hdf5 改为 hdf5_serial_hl ,hdf5_serial
注意:vim 搜索命令/待搜索字符,或?待搜索字符,使用n和N上下搜索
编译成功!!
继续编译
2.
sudo make testsudo make runtest
若sudo make runtest 出错 换成make runtest
参考 http://blog.csdn.net/greed7480/article/details/68486039
3.
make pycaffe
报错:python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory
sudo apt-get install python-numpy然后 sudo make pycaffe
成功
4. no module named skimage.io
缺少某个包可以直接用pip install scikit-image或sudo apt-get install python-skimage 安装
当多版本Python共存,需要将包安装到Python2.7中,但是使用pip install xxx会自动安装到系统默认的caffe下。
在指定Python中安装module的方法
使用whereis Python2.7 查看Python2.7的路径,替换上面路径需要安装在 /usr/lib/python2.7 还是 /usr/local/lib/python2.7/ 还是 /usr/local/lib/python2.7/site-packages/ ???
都试试,ls 查看 /usr/lib/python2.7 下文件夹,发现msragpu19无site-packages,最后安装在/usr/lib/python2.7/下。
安装后在Python中import skimage.io,可用!
再import caffe,查看还缺少什么包,重复上面步骤。
权限不够加sudo , sudo pip 报错no command,为Python2安装pip
- sudo apt-get install python-pip
Python3
- sudo apt-get install python3-pip
5. 遇到问题需要重新编译
make clean
make all
……
6. import caffe 报错 no module named google.protobuf
安装protobuf。
下载 wget https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-python-3.4.1.tar.gz 并解压
$ cd protobuf-3.4.1
$./configure
$make
$make check
$make install
对Python支持
$ cd python/
$ python setup.py test
$ python setup.py install
这次运气不错,再回到import caffe,work了!!!!
7. make runtest
报错:
libcudart.so.8.0: cannot open shared object file: No such file or directory
解决:
- sudo ldconfig /usr/local/cuda/lib64
报错:core dump
内核崩溃……………………就这样吧,没救了
- linux服务器下基于caffe的flownet搭建
- 在Linux环境下搭建基于Nginx的rtmp服务器
- 基于Linux系统Ubuntu下搭建Samba服务器
- linux环境下搭建一个基于tcp的客户端和服务器
- Linux下的svn服务器的搭建
- linux下的dhcp服务器的搭建
- linux下服务器搭建
- linux下服务器搭建
- Linux下HTTP服务器的搭建
- 【NFS】linux下nfs服务器的搭建
- linux 下svn 服务器的搭建
- linux下ftp服务器的搭建
- Linux下DNS服务器的搭建
- Linux下的搭建FTP服务器
- LINUX下FTP服务器的搭建
- Linux下Svn服务器的搭建
- linux下的ftp服务器搭建
- Linux下C++ gsoap服务器的搭建
- NPOCO
- Deeplearning4j 实战(6):基于LSTM的文本情感识别及其Spark实现
- 菱形继承
- Python2.7的安装教程
- Fragment的隐藏于显示
- linux服务器下基于caffe的flownet搭建
- 高精度模板(减法)
- HTML小网页案例
- Confluence知识库启动报错
- 在不同的情况运行Python
- 最短单源路径算法——SPFA
- 一张思维导图,让正则表达式不再难懂
- retorfit与Rxjava的权限
- LeetCode 617. Merge Two Binary Trees