centos7 安装caffe
时间: 2023-10-30 08:07:02 浏览: 103
CentOS7安装Caffe的教程详解
好的,以下是 centos7 安装 caffe 的步骤:
1. 安装依赖库
```
sudo yum install -y epel-release
sudo yum install -y cmake boost-devel gflags-devel glog-devel hdf5-devel leveldb-devel lmdb-devel opencv-devel protobuf-devel snappy-devel
```
2. 下载 caffe 源码
```
git clone https://github.com/BVLC/caffe.git
cd caffe
```
3. 编译安装
```
cp Makefile.config.example Makefile.config
# 修改 Makefile.config 中的配置,比如开启 cuDNN 支持等
make all -j8
make test -j8
make runtest -j8
make pycaffe -j8
```
4. 配置环境变量
```
echo "export CAFFE_ROOT=$(pwd)" >> ~/.bashrc
echo "export PYTHONPATH=$CAFFE_ROOT/python:$PYTHONPATH" >> ~/.bashrc
source ~/.bashrc
```
5. 测试
```
python -c "import caffe; print(caffe.__version__)"
```
如果输出了版本号,则说明安装成功。
阅读全文