在根据caffe2的官网,可以执行以下命令进行安装:
# For Caffe2 with CUDA 9 and CuDNN 7 support:
conda install pytorch-nightly -c pytorch
# For Caffe2 with CUDA 8 and CuDNN 7 support:
conda install pytorch-nightly cuda80 -c pytorch
笔者出现以下报错:
PackageNotFoundError: Package not found: '' Dependencies missing in current linux-64 channels:
- pytorch-nightly -> mkl >=2018
- pytorch-nightly -> python >=3.7,<3.8.0a0
解决办法:更新conda,执行命令conda update conda
。
使用命令
cd ~ && python -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"
测试是否安装成功: