Ubuntu16.04+cuda8.0rc+opencv3.1.0+caffe+Theano+torch7搭建教程
https://blog.csdn.net/jywowaa/article/details/52263711
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
$ nvidia-settings
# service lightdm stop
# vim /etc/modprobe.d/blacklist.conf
blacklist nouveau
- # chmod +x cuda*.run #获取文件权限
- # ./cuda*.run #执行文件安装
# vim /etc/profile
- PATH=/usr/local/cuda/bin:$PATH
- export PATH
# source /etc/profile
# vim /etc/ld.so.conf.d/cuda.conf
/usr/local/cuda/lib64
# ldconfig
# cd /usr/local/cuda/samples
# make all -j2 (我的本本是双核CPU,所以-j2都用上加快编译速度)
# ./deviceQuery
- $ sudo apt-get -y remove ffmpeg x264 libx264-dev
- $ sudo apt-get -y install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev x264 v4l-utils ffmpeg libgtk2.0-dev
- $ mkdir OpenCV
- $ cd OpenCV
- $ mkdir build
- $ cd build
- $ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
- $ make -j2
- $ sudo make install
- $ sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
- $ sudo ldconfig
- #include "precomp.hpp"
- #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
- #include "precomp.hpp"
- #if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000)
$ sudo apt-get install python-pip
- $ sudo pip install tornado pyzmq pygments
- $ sudo apt-get install libzmq-dev
$ sudo ipython notebook
$ sudo apt-get install python-numpy python-scipy python-matplotlib python-qt4 qt4-designer pyqt4-dev-tools python-qt4-doc spyder cython swig python-sklearn python-skimage python-h5py python-protobuf python-leveldb python-networkx python-nose python-pandas python-gflags ipython protobuf-c-compiler protobuf-compiler
- $ sudo apt-get update
- $ sudo apt-get install build-essential cmake git pkg-config libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libgflags-dev libgoogle-glog-dev liblmdb-dev python-dev
- $ sudo apt-get install --no-install-recommends libboost-all-dev
$ sudo apt-get install libatlas-base-dev
$ cp Makefile.config.example Makefile.config
- <pre name="code" class="html">注释第5行的 USE_CUDNN := 1
- 去掉注释第21行的 OPENCV_VERSION := 3
- 在 INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include 后面添加 /usr/include /usr/include/hdf5/serial
- 在 LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib 后面添加 /usr/lib/x86_64-linux-gnu/hdf5/serial
- 实现caffe对Python和Matlab接口的支持 PYTHON_LIB := /usr/local/lib
- $ make all -j2
- $ make test -j2
- $ make runtest -j2
$ make pycaffe -j2
error -- unsupported GNU version! gcc versions later than 5.3 are not supported!
- #if __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 3)
- //#error -- unsupported GNU version! gcc versions later than 5.3 are not supported!
- #endif /* __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 1) */
$ sudo pip install theano
$ sudo vim ~/.theanorc
- [global]
- openmp=False
- device=gpu
- floatX=float32
- allow_input-downcast=True
- [blas]
- ldflags=
- [nvcc]
- flags=-D_FORCE_INLINES
- from theano import function, config, shared, sandbox
- import theano.tensor as T
- import numpy
- import time
- vlen = 10 * 30 * 768 # 10 x #cores x # threads per core
- iters = 1000
- rng = numpy.random.RandomState(22)
- x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
- f = function([], T.exp(x))
- print(f.maker.fgraph.toposort())
- t0 = time.time()
- for i in range(iters):
- r = f()
- t1 = time.time()
- print("Looping %d times took %f seconds" % (iters, t1 - t0))
- print("Result is %s" % (r,))
- if numpy.any([isinstance(x.op, T.Elemwise) for x in f.maker.fgraph.toposort()]):
- print('Used the cpu')
- else:
- print('Used the gpu')
$ python test.py
- /usr/bin/python2.7 /home/hjimce/PycharmProjects/untitled/.idea/temp.py
- Using gpu device 0: GeForce 840M (CNMeM is disabled, cuDNN not available)
- [GpuElemwise{exp,no_inplace}(<CudaNdarrayType(float32, vector)>), HostFromGpu(GpuElemwise{exp,no_inplace}.0)]
- Looping 1000 times took 0.302778 seconds
- Result is [ 1.23178029 1.61879349 1.52278066 ..., 2.20771813 2.29967761
- 1.62323296]
- Used the gpu
- $ sudo apt-get install curl
- $ curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
- $ git clone https://github.com/torch/distro.git ~/torch --recursive
- $ cd ~/torch; ./install.sh
$ source ~/.bashrc
- $ th
- $ totch.Tensor{1,2,3}
- $ luarocks install image
- $ luarocks list
- $ luarocks install nngraph
- $ luarocks install optim
Ubuntu16.04+cuda8.0rc+opencv3.1.0+caffe+Theano+torch7搭建教程的更多相关文章
- Ubuntu16.04下安装OpenCV3.2.0
1.安装官方给的opencv依赖包 $ sudo apt-get install build-essential $ sudo apt-get install cmake git libgtk2.0- ...
- ubuntu16.04下安装opencv3.1.0
1.安装依赖项 sudo apt--dev pkg-config libavcodec-dev libavformat-dev libswscale-dev 可选的 sudo apt--dev lib ...
- ubuntu16.04下安装opencv-3.1.0及其扩展模块opencv_contrib
步骤1.安装依赖项 sudo apt--dev pkg-config libavcodec-dev libavformat-dev libswscale-dev 可选的 sudo apt--dev l ...
- 【深度学习】ubuntu16.04下安装opencv3.4.0
1.首先安装一些编译工具 # 安装编译工具 sudo apt-get install build-essential # 安装依赖包 sudo apt-get install cmake git li ...
- Ubuntu16.04+Cuda8.0+1080ti+caffe+免OpenCV3.2.0+faster-rCNN教程
一.事先声明:1.Ubuntu版本:Ubuntu使用的是16.04.而不是16.04.1或16.04.2,这三个是有区别的.笔者曾有过这样的经历,Git上一个SLAM地图构建程序在Ubuntu14.0 ...
- Ubuntu16.04 + cuda8.0 + GTX1080安装教程
1. 安装Ubuntu16.04 不考虑双系统,直接安装 Ubuntu16.04,从 ubuntu官方 下载64位版本: ubuntu-16.04-desktop-amd64.iso . 在MAC下制 ...
- Ubuntu16.04+CUDA8.0+cuDNN5.1+Python2.7+TensorFlow1.2.0环境搭建
软件版本说明:我选的Linux系统是Ubuntu16.04,CUDA用的8.0,Ubuntu16.04+CUDA8.0+cuDNN5.1+Python2.7只支持TensorFlow1.3.0以下的版 ...
- Ubuntu16.04+CUDA8.0+CUNN5.1+caffe+tensorflow+Theano
title: Ubuntu 16.04+CUDA8.0+CUNN5.1+caffe+tensorflow+Theano categories: 深度学习 tags: [深度学习框架搭建] --- 前言 ...
- Ubuntu16.04 +cuda8.0+cudnn+caffe+theano+tensorflow配置明细
本文为原创作品,未经本人同意,禁止转载,禁止用于商业用途!本人对博客使用拥有最终解释权 欢迎关注我的博客:http://blog.csdn.net/hit2015spring和http://www ...
随机推荐
- Oracle SQL常用语句
1,查询插入 insert into user_role(account_id, role_id, create_user) select t.employee_id, 'BC8FBF8B1D9843 ...
- 【LeetCode每天一题】Search in Rotated Sorted Array(在旋转数组中搜索)
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., ...
- [LeetCode] 364. Nested List Weight Sum II_Medium tag:DFS
Given a nested list of integers, return the sum of all integers in the list weighted by their depth. ...
- [Java in NetBeans] Lesson 15. Sorting and Searching.
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: Build in functions in java.util.Collections Need to implement a co ...
- JAVA编程思想学习笔记5-chap13-15-斗之气5段
1.String对象不可变,一旦发生字符变换或者变长度,一定是新建了一个String private final char value[]; 2.字符串+与+=:唯二操作符重载 "aaa&q ...
- cocos2d JS touch屏幕点击事件监听 cc.EventListener.TOUCH
var self = this; this.touchListener = cc.EventListener.create({ event: cc.EventListener.TOUCH_ONE_BY ...
- 网络编程之Socket的TCP协议实现客户端与客户端之间的通信
我认为当你学完某个知识点后,最好是做一个实实在在的小案例.这样才能更好对知识的运用与掌握 如果你看了我前两篇关于socket通信原理的入门文章.我相信对于做出我这个小案列是完全没有问题的!! 既然是小 ...
- JS实例4
根据当前年的前五年后五年的年月日 <select id="nian" onclick="Bian()"></select>年 <s ...
- net npoi将List<实体>导出excel的最简单方法
只是临时导数据用的.方便.最基本的方法, [HttpGet] [Route("ExportEnterprise")] public BaseResponse ExportEnter ...
- 2017高教杯数学建模B 题分析
B题原文 "拍照赚钱"是移动互联网下的一种自助式服务模式.用户下载APP,注册成为APP的会员,然后从APP上领取需要拍照的任务(比如上超市去检查某种商品的上架情况),赚取APP对 ...