ubuntu18+cuda9.0+python3.6 GPU安装caffe

想跑一下SSD试试,没有caffe环境所以下载了tf-ssd,效果不好也不收敛。故转战安装caffe跑SSD……

too young too simple,已经进坑两周了,今天终于灰头土脸的爬出来坑来了,其实有好几次都快要爬出来了,无知的自己选择把绳子剪断重新挂一条……现在回首过去的两周,幸亏自己心态好啊……

其实Ubuntu18 安装caffe非常简单

两句代码搞定

For Ubuntu (>= 17.04)

Installing pre-compiled Caffe

Everything including caffe itself is packaged in 17.04 and higher versions. To install pre-compiled Caffe package, just do it by

sudo apt install caffe-cpu

for CPU-only version, or

sudo apt install caffe-cuda

for CUDA version. Note, the cuda version may break if your NVIDIA driver and CUDA toolkit are not installed by APT.

Package status of CPU-only version

Package status of CUDA version

Installing Caffe from source

We may install the dependencies by merely one line

sudo apt build-dep caffe-cpu        # dependencies for CPU-only version
sudo apt build-dep caffe-cuda       # dependencies for CUDA version

接下来配置环境路径

gedit  ~/.bashrc

exprot PYTHONPATH="你的caffe安装路径:”$PYTHONPATH

source  ~/.bashrc

一般情况下会安装在/usr/lib/python3/dist-package里

重启一下

就可以打开Python

import caffe

测试一下~\(≧▽≦)/~啦

下载 caffe-ssd

git clone https://github.com/weiliu89/caffe.git

注意:由于该方法与Ubuntu17以下老版本的安装方式不同,路径甚至代码内容会有很多地方不一样,在运行SSD时需要进行更改,大家酌情选择…… 不过这个真的简单

你可能感兴趣的:(ubuntu18+cuda9.0+python3.6 GPU安装caffe)