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 ...
随机推荐
- PHP的类,abstract类,interface及关键字extends和implements
原文:https://blog.csdn.net/qq_19557947/article/details/77880757?locationNum=4&fps=1 PHP类 PHP类是单继承, ...
- sap 创建odata服务,通过http向数据库 进行增删改查
https://blog.csdn.net/stone0823/article/details/71057172 1:通过 事物码 se11 创建 数据库表 zemp.表 zemp中 含有empid ...
- js中实现IE的打印预览
HTML中添加:<object id="WebBrowser" classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 widt ...
- 【LeetCode每天一题】Reverse String
Write a function that reverses a string. The input string is given as an array of characters char[]. ...
- ODBC的JAR包和PLSQL
eclipse编辑器,写java 下载ODBC的JAR包 配置一下用户名和密码 java连接上数据库后 不是直接操作数据库 在代码里面有SQL语句 代码执行的时候遇到这些语句就可以操作数据库 平时操 ...
- 10.C# 构造函数
1.构造函数 构造函数是用来初始化对象的,只能由new运算符调用.构造函数与类同名,没有返回值,不能用void修饰,可以有public和private两种修饰符,当用private修饰时外界不能访问到 ...
- iOS - (多图上传已封装)
/*** 上传带图片的内容,允许多张图片上传(URL)POST** @param url 网络请求地址* @param images ...
- 理解tcp顺序释放操作和tcp的半关闭
Shutdown的调用 在关闭socket的时候,可以有两种方式closesocket和shutdown,这两个函数的区别在什么地方呢? #include <sys/socket. ...
- Lepus(天兔)监控MySQL部署
http://www.dbarun.com/docs/lepus/install/lnmp/ 注意:xampp mysqldb-python版本太高会导致lepus白屏 apache版本最好选择2.2 ...
- python多版本控制
1安装git # yum install git -y 2.安装python依赖 # yum -y install gcc make patch gdbm-devel openssl-devel sq ...