Ubuntu16.04 安装 Caffe, opencv3, cuda8

前端之家收集整理的这篇文章主要介绍了Ubuntu16.04 安装 Caffe, opencv3, cuda8前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1.1 install ubuntu 16.04 with win10 choose [UEFI both]

1.2 update download source



2 install caffe[https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide]


2.1 install some pacakges

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install -y build-essential cmake git pkg-config

sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler

sudo apt-get install -y libatlas-base-dev 

sudo apt-get install -y --no-install-recommends libboost-all-dev

sudo apt-get install -y libgflags-dev libgoogle-glog-dev liblmdb-dev

# (Python general)
sudo apt-get install -y python-pip

# (Python 2.7 development files)
sudo apt-get install -y python-dev
sudo apt-get install -y python-numpy python-scipy

# (or,Python 3.5 development files)
#sudo apt-get install -y python3-dev
#sudo apt-get install -y python3-numpy python3-scipy

# (OpenCV 2.4)
#sudo apt-get install -y libopencv-dev

#(or,OpenCV 3.1 - see the instructions below)


2.2 install nvidia driver



2.3 install cuda https://developer.nvidia.com/cuda-downloads


2.4 copy cudnn https://developer.nvidia.com/cudnn


2.5 install opencv3


sudoapt-get install --assume-yes build-essential cmake git











sudo apt-get install --assume-yes build-essential pkg-config unzip ffmpeg qtbase5-dev python-dev python3-dev python-numpy python3-numpysudo apt-get install --assume-yes libopencv-dev libgtk-3-dev libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-devsudo apt-get install --assume-yes libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-devsudo apt-get install --assume-yes libv4l-dev libtbb-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-devsudo apt-get install --assume-yes libvorbis-dev libxvidcore-dev v4l-utilsgit clone https://github.com/opencv/opencv.gitmkdir buildcd build/cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_CUBLAS=ON -DCUDA_NVCC_FLAGS="-D_FORCE_INLINES" .. make -j $(($(nproc) + 1))

Integrationwith the Caffe

Returnto the Caffe directory and perform a cleanup operation with thecommand

makeclean

(Readmorehere:https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide)

First,edit the Makefile.config to include the OpenCV 3.1 library likethis...

OPENCV_VERSION:= 3

LIBRARY_DIRS:= $(PYTHON_LIB) /usr/local/lib /usr/lib/usr/lib/x86_64-linux-gnu/hdf5/serial/usr/local/share/OpenCV/3rdparty/lib/

Then,recompile the entire Caffe project.

2.6 configure Makefilehttps://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide

猜你在找的Ubuntu相关文章