安装Caffe
安装步骤
- Nvidia CUDA 7.5
- cuDNN
- Python2.7/3.5
- Opencv2/3
- github.com/BVLC/caffe
- 官网更新包命令
- 编译前修改配置文件
- 环境变量
- 测试 import caffe
安装依赖
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libopenblas-dev
安装python库
git clone https://github.com/BVLC/caffe.git
cd caffe/python
for req in $(cat requirements.txt); do pip install $req; done
编译安装
mkdir build
cd build
cmake ..
make -j2
make install
make runtest
make 报错
conda uninstall libtiff
python3 导入caffe报错
ImportError: dynamic module does not define module export function (PyInit__caffe)
caffe还不能很好的支持python3,这里会报导入错误。可以修改成python2后再导入。要在python2中安装东西时要用 python2 -m pip install ... 来安装,不然默认安装在了python3中。