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 ...
随机推荐
- Hive和SparkSQL:基于 Hadoop 的数据仓库工具
Hive 前言 Hive 是基于 Hadoop 的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供完整的 SQL 查询功能,将类 SQL 语句转换为 MapReduce 任务执行. ...
- mysql相关SQL
1.mysql分组获取最新数据 sql> select max(column_name) from table group by column_name having count(*) orde ...
- 正则表达式匹配域名、网址、url
DNS规定,域名中的标号都由英文字母和数字组成,每一个标号不超过63个字符,也不区分大小写字母.标号中除连字符(-)外不能使用其他的标点符号.级别最低的域名写在最左边,而级别最高的域名写在最右边.由多 ...
- JavaScriptSerializer的日期转换方案
1.转换后过滤替换(通用) /// <summary> /// 日期转换 /// </summary> /// <param name="str"&g ...
- Python对list列表及子列表进行排序
python代码,对list进行升序排序,所有子列表也要进行排序 def iterList(listVar): listVar = sorted(listVar) for i,v in enumera ...
- React项目中使用Mobx状态管理(二)
并上一节使用的是普通的数据状态管理,不过官方推荐使用装饰器模式,而在默认的react项目中是不支持装饰器的,需要手动启用. 官方参考 一.添加配置 官方提供了四种方法, 方法一.使用TypeScrip ...
- C# 5.0五大新特性
第一:绑定运算符,:=: 这个只是简化了数据绑定,跟ASP.NET MVC3不断改进一样,其实不是什么亮点改进. comboBox1.Text :=: textBox1.Text; //将文本框的内容 ...
- linux基本格式和常用目录命令一
1: cd 绝对路径 2: cd 相对路径 名字开头 ./开头 ../开头 3: cd ~: 去到当前用户所在目录; 4: pwd获取当前的路径的绝对路径; 5: ls 与ls -l 6: cat 操 ...
- 《大话设计模式》c++实现 原型模式
意图:用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象. 主要解决:在运行期建立和删除原型. 何时使用: 1.当一个系统应该独立于它的产品创建,构成和表示时. 2.当要实例化的类是在运行 ...
- 使用.NET向webService传double、int、DateTime 服务器得到的数据时null的问题(转http://blog.csdn.net/slimboy123/article/details/4366701)
用C#.NET调用Java开发的WebService时,先在客户端封装的带有int属性的对象,当将该对象传到服务器端时,服务器端可以得到string类型的属性值,却不能得到int类型.double和D ...