yum install epel-release
yum install atlas-devel snappy-devel boost-devel leveldb leveldb-devel hdf5 hdf5-devel glog glog-devel gflags gflags-devel protobuf protobuf-devel opencv opencv-devel lmdb lmdb-devel
yum install git
git clone https://github.com/BVLC/caffe.git
cd caffe/
cp Makefile.config.example Makefile.config
yum install vim
yum install gcc
yum -y groupinstall "Development Tools"
yum -y install cmake pkgconfig gtk2-devel python-devel numpy tbb-devel libpng-devel
yum install lrzsz
git clone https://github.com/xianyi/OpenBLAS.git
make CC=gcc-4.7 FC=gfortran
make
make PREFIX=/usr/local install
ln -s *.so /usr/lib
ln -s *.so.0 /usr/lib
vim ~/.bashrc
add:
export PYTHONPATH=/home/caffe/caffe/python:$PYTHONPATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/glog/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
可能需要重启才能生效-无需重启,断开连接再连接即可
编译caffe make runtest报错无法找到libopenblas.so.0 的错误
直接执行:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/glog/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
后可以了
cd caffe
vim Makefile.config
CPU_ONLY := 1
BLAS := atlas 改为 BLAS := open
添加:
BLAS_INCLUDE := /usr/local/include
BLAS_LIB := /usr/local/lib
make all -j12
make test
make runtest
yum -y install python-pip
cd python/
for req in $(cat requirements.txt); do pip install $req; done
vim /etc/ld.so.conf.d/caffe.conf
add:
/usr/local/lib64
/usr/local/lib
ldconfig
cd /home/caffe/caffe
make pycaffe
pip install -U scikit-learn
python
import caffe 报错:ImportError: No module named caffe
执行 echo $PYTHONPATH 输出为空
执行export PYTHONPATH=/home/caffe/caffe/python:$PYTHONPATH 可以了 还是./bashrc 没生效,需验证是否重启-无需重启,断开连接再连接即可
No module named sklearn.svm.classes
pip install -U scikit-learn