Install Caffe on CentOS 6.5
2015-10-10 21:00
1026 查看
Check all path setting and configurations to see whether they are effective before compiling.
Download and install Nvidia driver. Test with
Dowlaod and install CUDA tool kit, consist with the versioin of driver. Test with
Install Python 2.7 on CentOS 6
Then you have both python2.6 and python2.7. You have to specify python2.7 and pip2.7 in the command.
Change Caffe
Using
After download OpenCV 2.4 source file,
Several pits
You should specify
You should download a new file
If you find some bugs like
link
link
link
I try to manually compile the .cpp file, but encounter with include and link errors, such as
Solution
Or you could add atlas and boost to the link path
2, Saving snapshot for deploy and resuming training. But how?
CUDA
Add the card. 2 cables.Download and install Nvidia driver. Test with
nvidia-smi
Dowlaod and install CUDA tool kit, consist with the versioin of driver. Test with
deviceQuery
Others
Try this first, if they are not properly installed, refer to tips below.sudo yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel
sudo yum install gflags-devel glog-devel lmdb-devel
BLAS
sudo yum install blas-devel lapack-devel atlas-devel
BOOST
sudo yum install boost
Python
Caffe need Python>=2.7. But CentOS 6.5 used Python2.6 as default for core functions, such as yum.Install Python 2.7 on CentOS 6
Then you have both python2.6 and python2.7. You have to specify python2.7 and pip2.7 in the command.
Change Caffe
Makefile.configurefile according to the new path to python2.7.
51 PYTHON_INCLUDE := /usr/local/lib/python2.7 \ 52 /usr/local/lib/python2.7/site-packages/numpy/core/include
openCV
Caffe need openCV>2.4, which can not be installed automatically by yum in CentOS 6.5.Using
whereisand
locateto find out where Python2.7 is.
After download OpenCV 2.4 source file,
export PYTHON_EXECUTABLE=/usr/local/bin/python2.7 export PYTHON_INCLUDE_PATH=${PYTHON_EXECUTABLE%/*/*}/include/python2.7 export PYTHON_LIBRARY=${PYTHON_EXECUTABLE%/*/*}/lib/libpython2.7.a export PYTHON_NUMPY_INCLUDE_DIR=${PYTHON_EXECUTABLE%/*/*}/lib/python2.7/site-packages/numpy/core/include/numpy export PYTHON_PACKAGES_PATH=${PYTHON_EXECUTABLE%/*/*}/lib/python2.7/site-packages cmake -D CUDA_GENERATION=Kepler -D PYTHON_EXECUTABLE=$PYTHON_EXECUTABLE -D PYTHON_INCLUDE_PATH=$PYTHON_INCLUDE_PATH -D PYTHON_LIBRARY=$PYTHON_LIBRARY -D PYTHON_NUMPY_INCLUDE_DIR=$PYTHON_NUMPY_INCLUDE_DIR -D PYTHON_PACKAGES_PATH=$PYTHON_PACKAGES_PATH -D CMAKE_BUILD_TYPE=RELEASE .. make -j 4 sudo make install
Several pits
nvcc fatal : Unsupported gpu architecture 'compute_11'
You should specify
cmake -D CUDA_GENERATION=Kepler ..
/home/Simon/Work/dependence/opencv2.4/opencv-2.4.9/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp(121): error: a storage class is not allowed in an explicit specialization
You should download a new file
NCVPixelOperations.hppto fix this bug.
If you find some bugs like
Python.h: No such file., you should check the path settings above, making sure that they are effective.
link
link
link
Caffe Compile
cmake -D CUDA_GENERATION=Kepler -D PYTHON_EXECUTABLE=$PYTHON_EXECUTABLE -D PYTHON_INCLUDE_PATH=$PYTHON_INCLUDE_PATH -D PYTHON_LIBRARY=$PYTHON_LIBRARY -D PYTHON_NUMPY_INCLUDE_DIR=$PYTHON_NUMPY_INCLUDE_DIR -D PYTHON_PACKAGES_PATH=$PYTHON_PACKAGES_PATH -D CMAKE_BUILD_TYPE=RELEASE .. make -j 4 sudo make install
Mnist Example
According to tutorial, all should be done in $CAFFE_ROOT.I try to manually compile the .cpp file, but encounter with include and link errors, such as
file xx do not existor
undefined reference to xxx:xxxx. I try to fix them by using
g++ -Ixxx/include -Lxxx/lib, but it is too complex, and confusing. After yum install and make install all these packages, how can I suppose to know where to find those header files, library files and links?
Makefilein $CAFFE_ROOT defined all those files needed for compilation.
Bugs log
/usr/bin/ld: cannot find -lboost_thread collect2: ld returned 1 exit status make: *** [.build_release/lib/libcaffe.so] Error 1
Solution
sudo ln -s /opt/maxcompiler-2014.1.1/lib/boost/lib/libboost_thread.so /usr/lib/libboost_thread.so
Or you could add atlas and boost to the link path
LD_LIBRARY_PATH.
pycaffe
要根据实际情况(locate Python.h)修改python_include_path, 然后Make pyCaffe.
Model Training
1, No graceful way to exit, stop training with Ctrl-c. Need a tool for training curve plotting.2, Saving snapshot for deploy and resuming training. But how?
Reference
Caffe相关文章推荐
- VMware虚拟机克隆Linux系统后找不到eth0网卡的问题
- Linux 目录结构及文件基本操作,转载自实验楼
- Linux 创建信任机制
- linux文件系统 硬链接和软连接(符号连接)
- Linux学习13_配置yum,nc,telnet
- linux tar 压缩
- LINUX查看系统日志
- 《Linux Device Drivers》第十二章 PCI司机——note
- 利用python模块paramiko在CentOS 6.3 64上搭建SFTP环境
- linux下mysql自动dump
- Linux文件管理类命令及命令别名
- linux统计一个文件中特定字符的个数
- linux安装mysql
- Linux命令 grep
- Linux将程序前台转后台执行
- Linux系统学习
- Linux系统升级gcc/g++
- linux 常用命令
- centos7 修改默认语言
- linux 各个文件系统之间的关系