1.安装python: yum install python-devel.x86_64
2.安装一些python库依赖(这些是我们在后来调试时发现会漏安装,导致python命令模式下Import caffe出错)
yum install python-matplotlib.x86_64
#pip install scikit-image
sudo easy_install -U scikit-image
3.安装python的其他依赖
cd $CAFFE_ROOT/python
for req in $(cat requirements.txt); do pip install $req; done
4.编译
make clean
make pycaffe -j32
make test -j32
5. 使Caffe的python接口永久生效
export PYTHONPATH=/root/$CAFFE_ROOT/python:$PYTHONPATH
source /etc/profile
注意:每次如果测试import caffe时某个lib库缺失,需要安装后,重复执行4,5步
时间: 2024-11-09 02:29:13