caffe2安装

1、查看cuda和cudnn版本

cuda 版本
cat /usr/local/cuda/version.txt

cudnn 版本
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

2、可以讲cuda和cudnn升级到8.0和7

3、安装caffe2,用conda安装比较方便,如果环境不匹配可以多试几次

conda install -c caffe2 caffe2-cuda8.0-cudnn7

4、之后还要安装NCCL2

  1. Install the repository.
    • For the local NCCL repository:
      sudo dpkg -i nccl-repo-<version>.deb

这里首先下载了nccl-repo-ubuntu1404-2.1.15-ga-cuda8.0_1-1_amd64.deb,之后通过

sudo apt-get install libnccl2 libnccl-dev   安装相应的库,之后运行如下验证代码:
# To check if Caffe2 build was successful
python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"

# To check if Caffe2 GPU build was successful
# This must print a number > 0 in order to use Detectron
python -c 'from caffe2.python import workspace; print(workspace.NumCudaDevices())'
都ok说明caffe2安装完成。


猜你喜欢

转载自blog.csdn.net/fireflychh/article/details/80454802