win10+ubuntu16.04+cuda+opencv3.2+caffe(gpu)+tensorflow(gpu)

一、双系统:win10分盘:


win10+ubuntu16.04+cuda+opencv3.2+caffe(gpu)+tensorflow(gpu)_第1张图片
win10+ubuntu16.04+cuda+opencv3.2+caffe(gpu)+tensorflow(gpu)_第2张图片
win10+ubuntu16.04+cuda+opencv3.2+caffe(gpu)+tensorflow(gpu)_第3张图片

安装ubuntu

制作ubuntu系统启动u盘(略)

插入制作好的ubuntu系统u盘:

按下esc或f2或f11,进入:
win10+ubuntu16.04+cuda+opencv3.2+caffe(gpu)+tensorflow(gpu)_第4张图片
win10+ubuntu16.04+cuda+opencv3.2+caffe(gpu)+tensorflow(gpu)_第5张图片
此电脑硬盘128G+1T
选择最后一项:something else,手动分盘
分盘过程中,可都选择逻辑分区,此电脑需要添加一个use as EFI的分区才能正确分盘。
win10+ubuntu16.04+cuda+opencv3.2+caffe(gpu)+tensorflow(gpu)_第6张图片
下一步
等待安装完成。

二、配置caffe等CUDA软件环境

pre-work:

Ctrl + Alt + T : open Terminal

sudo apt-get install libprotobuf-dev protobuf-compiler libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler python-pip python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler python-numpy python-scipy python-matplotlib python-sklearn python-skimage python-h5py python-protobuf python-leveldb python-networkx python-nose python-pandas python-gflags cython ipython protobuf-c-compiler protobuf-compiler
pip install scikit-image
pip install protobuf
pip install sklearn
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev liblapacke-dev libxvidcore-dev libx264-dev libatlas-base-dev gfortran ffmpeg

CUDA+CUDNN

goto CUDA dir:
1.

sudo gedit /etc/modprobe.d/blacklist.conf

add:

blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv

2.#remove former drivers

sudo apt-get remove –purge nvidia-*
sudo apt-get remove –purge xserver-xorg-video-nouveau
sudo reboot

3.
3.1:

Ctrl + Alt + F1
sudo /etc/init.d/lightdm stop
1:install CUDA 8.0
sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
sudo reboot

sudo gedit /etc/profile

append these :

export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
export LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LIBRARY_PATH

and:

sudo gedit /etc/ld.so.conf.d/cuda-8-0.conf

add:

/usr/local/cuda-8.0/lib64 (im not sure useful or not)

sudo ldconfig

3.2:install cudnn5.1

sudo cp ./cuda/include/cudnn.h /usr/local/cuda-8.0/include/
sudo cp ./cuda/lib64/lib* /usr/local/cuda-8.0/lib64/
cd /usr/local/cuda-8.0/lib64/
sudo rm -rf libcudnn.so libcudnn.so.5 #删除原有动态文件
sudo ln -s libcudnn.so.5.1.10 libcudnn.so.5 #生成软衔接
sudo ln -s libcudnn.so.5 libcudnn.so #生成软链接

sudo cp /usr/local/cuda-8.0/lib64/libcudart.so.8.0 /usr/local/lib/libcudart.so.8.0
sudo cp /usr/local/cuda-8.0/lib64/libcublas.so.8.0 /usr/local/lib/libcublas.so.8.0
sudo cp /usr/local/cuda-8.0/lib64/libcurand.so.8.0 /usr/local/lib/libcurand.so.8.0
sudo cp /usr/local/cuda-8.0/lib64/libcudnn.so.5 /usr/local/lib/libcudnn.so.5

sudo ldconfig
sudo reboot

when rebooted , you can use

nvidia-smi
nvcc -V

to test nvidia-driver

Install OpenCV 3.2 + contrib

goto oepncv3.2 dir:

mkdir build
cd build

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.2.0/modules/ ..

make all -j8
sudo make install

use :

python
import cv2
to test

install caffe-ssd

goto caffe-ssd dir:

make clean
make -j8 (if error in proto.pb.h sudo make all without -j8)
make py (make pycaffe)
make test -j8
make runtest -j8

sudo gedit /etc/profile
export PYTHONPATH=/home/sy/caffe-ssd/python:$PYTHONPATH

when rebooted, everything is working.

Next, install my other face recognition program and use it .
win10+ubuntu16.04+cuda+opencv3.2+caffe(gpu)+tensorflow(gpu)_第7张图片
if want to get my package with above three aspect, please write down your email.(not include face recognition)

你可能感兴趣的:(tensorflow,安装,caffe)