文档章节

Ubuntu上安装DeepDream图像深度学习系统

openthings
 openthings
发布于 2016/03/03 13:40
字数 753
阅读 144
收藏 1

There are a lot of steps here but they're very straightfoward.  I pulled my AMD card out this afternoon after work, installed the Nvidia GPU, and had Deep Dream up and running in a short time.  Take your time, explicitly follow each step, and you should be good to go.  I'm running Linux Mint 17, which is built from Ubuntu 14.04 LTS. I'm also working with Python 2.7.  If you are on a different version then change the file path for caffe accordingly.


THIS PART IS ONLY NECESSARY IF YOU HAVE A COMPATIBLE GPU.  IF NOT GO TO "INSTALLING CAFFE"

You will need an Nvidia GPU with compute capability >=3.0.  I will post instructions on cuDNN installation tomorrow.  In the meantime you can see if your GPU will work here - https://en.wikipedia.org/wiki/CUDA#Supported_GPUs


INSTALLING CUDA 7.0 and NVIDIA DRIVERS

Pull up terminal and issue the following commands:

sudo apt-get --purge remove nvidia*
sudo su
echo nouveau >> /etc/modprobe.d/blacklist.conf
cd ~/Downloads
mkdir nvidia_installer
cd nvidia_installer
wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.28_linux.run
chmod +x cuda_7.0.28_linux.run
./cuda_7.0.28_linux.run -extract=~/Downloads/nvidia_installer

Time to disable the Nouveau driver to install the Nvidia drivers

sudo gedit /etc/default/grub

Edit to to reflect this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

Reboot

Ctrl+Alt+F1 to go to terminal screen

Issue these commands:

sudo service mdm stop
sudo init 3
cd ~/Downloads/nvidia_installer
sudo ./NVIDIA-Linux-x86_64-346.46.run
sudo modprobe nvidia
sudo ./cuda-linux64-rel-7.0.28-19326674.run
sudo ./cuda-samples-linux-7.0.28-19326674.run
sudo init 5
sudo service mdm start

Ctrl+Alt+F7 to get back to graphical window.  Pull up terminal

cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make
sudo ./deviceQuery

You should see something similar to this - CLICK


INSTALLING CAFFE  - SEE NEXT STEP FOR MULTICORE SUPPORT (READ THAT FIRST)

This was the most difficult part but I think I've ironed out any bumps you might hit.

sudo apt-get install build-essential git
cd ~
git clone https://github.com/BVLC/caffe.git
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev python python-dev python-scipy python-setuptools python-numpy python-pip libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler libatlas-dev libatlas-base-dev libatlas3-base libatlas-test
sudo apt-get install --no-install-recommends libboost-all-dev
sudo pip install --upgrade pip
sudo pip install --upgrade numpy
cd ~/caffe
cp Makefile.config.example Makefile.config

If you want to use cudNN, you will need to register with Nvidia and make the following change to Makefile.config: Uncomment

USE_CUDNN := 1

Back to the install:  If you're not using CUDA, then you'll want CPU only mode.  Edit Makefile.config and uncomment

 CPU_ONLY := 1

I'm sure some of this is redundant, but you will need to add these to ~/.bashrc

export PATH=$PATH:/usr/local/cuda-7.0/bin
export LD_LIBRARY_PATH=:/usr/local/cuda-7.0/lib64
export PYTHONPATH="${PYTHONPATH}:/home/USERNAME/caffe/python"
export PATH=/usr/local/cuda/bin:${PATH}
PATH=${CUDA_HOME}/bin:${PATH} 
export PATH
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=:/usr/local/cuda/lib64

You will substitute X for the number of cores in your machine.

source ~/.bashrc
make all -jx
make test -jx
make runtest -jx
make pycaffe -jx

CAFFE WITH MULTICORE SUPPORT

If you have multiple cores, which you probably do because it's 2015, and you have access to the Intel MKL, then you can build caffe to make use of every core.  In these directions I'm assuming you've installed the MKL (If you're installing MKL and it gives you an error about an unsupported OS just continue, it works).  I am also assuming you don't want to/can't use your GPU.

cd ~/caffe
cp Makefile.config.example Makefile.config
gedit Makefile.config

Uncomment line 8 that says

CPU_ONLY := 1

Change line 33 to

BLAS := mkl

Uncomment lines 37 and 38 and add the path to your mkl include and lib directories.  I installed composerXE so my lines 37 and 38 look like this

BLAS_INCLUDE := /opt/intel/composer_xe_2011_sp1.10.319/mkl/include
BLAS_LIB := /opt/intel/composer_xe_2011_sp1.10.319/mkl/lib/intel64

Again, use the path to your mkl lib directory here

sudo ldconfig /opt/intel/composer_xe_2011_sp1.10.319/mkl/lib/intel64/

After that follow the directions above starting with the section on editing ~/.bashrc


RUNNING DEEP DREAM

cd ~
git clone https://github.com/google/deepdream.git
wget -P ~/caffe/models/bvlc_googlenet http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel
cd ~/deepdream
ipython notebook ./dream.ipynb

Click inside each body of code and hit the play button.  Wait and watch as your computer displays its deepest thoughts.


PASTEBIN RAW

Deep dream python script with loop - http://pastebin.com/1ePNC89A


本文转载自:https://www.reddit.com/r/deepdream/comments/3cd1yf/howto_install_on_ubuntulinux_mint_including_cuda/

openthings
粉丝 324
博文 1140
码字总数 689435
作品 1
东城
架构师
私信 提问
深度学习之 TensorFlow(三):TensorFlow 源代码解析

分析一下 TensorFlow 的文件结构。这里的源代码版本是 TensorFlow1.7.0 。 目录结构如下: 其中的核心目录是 tensorflow 目录,最重要的源代码保存在这里,目录结构如下: 1.contrib 目录中保...

希希里之海
2018/05/09
0
0
谷歌和OpenAI开发新工具,以更好地研究机器视觉算法如何理解世界

AI的世界到底是什么样子的?几十年来,研究人员一直对此感到困惑,但近年来,机器视觉系统正在越来越多的生活领域得到应用,但是通过机器的眼睛去理解为什么它将行人和路标分别归类仍然是一个...

ATYUN
03/07
0
0
第3章 TensorFlow入门

第3章 TensorFlow入门 TensorFlow是Google创造的数值运算库,作为深度学习的底层使用。本章包括: TensorFlow介绍 如何用TensorFlow定义、编译并运算表达式 如何寻求帮助 注意:TensorFlow暂...

优惠券发放
2018/05/31
0
0
CS231n (winter 2016) : Assignment3

前言: 以斯坦福cs231n课程的python编程任务为主线,展开对该课程主要内容的理解和部分数学推导。建议PC端阅读,该课程的学习资料和代码如下: 视频和PPT 笔记 assignment3初始代码 Part 1:...

Deepool
2016/07/29
0
0
是“洗稿”还是“创作” AI画作所有权该归谁?

在过去几年里,许多艺术家开始使用所谓的“神经网络软件”来创作艺术品。用户将现有的图像输入软件,然后软件会对这些图像进行分析,学习其中特定的美学因素,并生成艺术家想要的新图像。通过...

网易智能
04/09
0
0

没有更多内容

加载失败,请刷新页面

加载更多

Eureka应用注册与集群数据同步源码解析

在之前的EurekaClient自动装配及启动流程解析一文中我们提到过,在构造DiscoveryClient类时,会把自身注册到服务端,本文就来分析一下这个注册流程 客户端发起注册 boolean register() t...

Java学习录
23分钟前
4
0
Java描述设计模式(15):责任链模式

本文源码:GitHub·点这里 || GitEE·点这里 一、生活场景描述 1、请假审批流程 公司常见的请假审批流程:请假天数 当 day<=3 天,项目经理审批当 3<day<=5 天,部门经理审批当 day>5 天...

知了一笑
33分钟前
6
0
总结:数组与链表

1、内存申请:数组在内存上是连续的空间;链表,内存地址上可以是不连续的。 2、查询速度:数组可以随机访问,链表必须顺序访问,即从首个元素开始遍历,逐个查找,所以数组查询很快。 3、写入...

浮躁的码农
42分钟前
6
0
HashMap源码分析

read

V丶zxw
今天
5
0
Python字符串或JSON字符串转字典dict、列表list

有3种方法 1、使用ast模块 >>> import ast>>> s = '["test",1]'>>> ast.literal_eval(s)['test',1]>>> s = '{"test":1}'>>> ast.literal_eval(s){'test': 1} 2、eval函数,这个......

编程老陆
今天
7
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部