Ubuntu14.04安装Theano详细教程

转载 2016年06月01日 21:49:46

原文地址

http://blog.csdn.net/niuwei22007/article/details/47684673

因为最近需要学习深度学习,因此想要配置Theano,来开发深度学习算法。但是发现Theano安装总是出现问题。于是在这里中总结一下。

环境

  • 操作系统:ubuntu14.04
  • Python:2.7.6
  • 需要联网

相关库简介

  • BLAS(Basic Linear Algebra Subprograms)是基础线性代数子程序库,里面拥有大量已经编写好的关于线性代数运算的程序;
  • LAPACK (Linear Algebra PACKage)包含了求解科学与工程计算中最常见的数值线性代数问题,如求解线性方程组、线性最小二乘问题、特征值问题和奇异值问题等;
  • ATLAS是python下的一个线性代数库,是基于另外两个线性代数库BLAS和lapack的;
  • NumPy提供了一个在python中做科学计算的基础库,它重在数值计算,甚至可以说是用于多维数组处理的库;
  • SciPy是基于numpy,提供了一个在python中做科学计算的工具集,也就是说它是更上一个层次的库;
  • Theano则是基于NumPy以及SciPy的一个更高级的用于科学计算的库。

相关库的关系

  • 要安装Theano,就需要先安装好numpy和scipy;
  • 要安装numpy和scipy,就需要ATLAS;
  • 要安装ATLAS,就需要安装BLAS和LAPACK;

相关库的安装顺序

  • 安装顺序:BLAS → LAPACK → ATLAS → numpy → scipy → Theano

检查numpy和scipy是否通过测试

  • 说明:如果你的numpy和scipy是通过apt-get安装的,那么它们的单元测试可能会通不过!!!(我在安装过程中没有通过测试,scipy出现了Error
  • 如果numpy或scipy不能通过测试,就需要卸载,然后重新按照本文介绍的顺序安装。
<code class="language-bash hljs  has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 检查numpy是否通过测试</span>
python -c <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"import numpy;numpy.test()"</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li></ul>
  • 如果numpy通过测试,会出现如下图所示的结果。注意最后一行errors=0 failures=0。如果没有通过测试,需要卸载并重新安装。 
    numpy测试结果

  • 如果scipy通过测试,会出现如下图所示的结果。注意最后一行errors=0 failures=0。如果没有通过测试,需要卸载并重新安装。 
    scipy通过测试

  • 注意:scipy很可能会出现测试错误,比如我安装过程中出现下图所示的错误。 
    scipy测试错误

卸载numpy和scipy

<code class="language-bash hljs  has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 卸载numpy</span>
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get remove python-numpy

<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 卸载scipy</span>
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get remove python-scipy</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul>

安装各种包

<code class="language-bash hljs  has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 安装gfortran,后面编译过程中会用到</span>
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get install gfortran
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 安装blas,Ubuntu下对应的是libopenblas,其它操作系统可能需要安装其它版本的blas——这是个OS相关的。</span>
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get install libopenblas-dev
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 安装lapack,Ubuntu下对应的是liblapack-dev,和OS相关。</span>
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get install liblapack-dev
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 安装atlas,Ubuntu下对应的是libatlas-base-dev,和OS相关。</span>
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get install libatlas-base-dev</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li></ul>

安装numpy和scipy

  • 使用pip安装numpy和scipy
  • 安装pip的命令:sudo apt-get install python-pip
  • 注意:一定要在安装完lapack/blas之后,再安装numpy和scipy。否则,会出现错误no lapack/blas resources found
  • 安装numpy和scipy的命令如下所示。
<code class="language-bash hljs  has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 安装numpy</span>
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> pip install numpy
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 测试numpy</span>
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 测试通过才能进行下一步~~</span>
python -c <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"import numpy;numpy.test()"</span>

<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 安装scipy</span>
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> pip install scipy
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 测试scipy</span>
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 测试通过才能进行下一步~~</span>
python -c <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"import scipy;scipy.test()"</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li><li style="box-sizing: border-box; padding: 0px 5px;">10</li><li style="box-sizing: border-box; padding: 0px 5px;">11</li></ul>

安装线性计算库、numPy和sciPy的编译方法(推荐)

编译安装OpenBlas

<code class="language-bash hljs  has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">tar -zxvf OpenBLAS**.tar.gz
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">cd</span> OpenBLAS***
make -FC gfortran <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#需要已经安装gfortran </span>
make install <span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 安装在/opt/OpenBLAS/目录下</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li></ul>

安装numPy

<code class="language-bash hljs  has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">tar -zxvf numpy***.tar.gz
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">cd</span> numpy***
cp site.cfg.example site.cfg
vi site.cfg
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#将以下4行去掉注释。【101行--104行】</span>
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#[openblas]</span>
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#libraries = openblas</span>
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#library_dirs = /opt/OpenBLAS/lib</span>
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#include_dirs = /opt/OpenBLAS/include</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li><li style="box-sizing: border-box; padding: 0px 5px;">7</li><li style="box-sizing: border-box; padding: 0px 5px;">8</li><li style="box-sizing: border-box; padding: 0px 5px;">9</li></ul>
  • 安装numPy。
<code class="hljs bash has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> python setup.py config
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> python setup.py build
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> python setup.py install </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li></ul>

安装sciPy

<code class="language-bash hljs  has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">tar -zxvf scipy***.tar.gz
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">cd</span> scipy***
<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 将numPy**中的配置文件复制到此处</span>
cp ../numpy**/site.cfg.example ./site.cfg</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li></ul>
  • 安装sciPy。
<code class="hljs bash has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> python setup.py config
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> python setup.py build
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> python setup.py install </code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li></ul>

安装其它库

  • 为了安装Theano,最后还需要安装一些库,可以参考官方教程
<code class="language-bash hljs  has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get install python-dev
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get install python-pip
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get install python-nose
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get install g++
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> apt-get install git 
</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li><li style="box-sizing: border-box; padding: 0px 5px;">6</li></ul>

安装Theano

  • 前面的操作如果没有出现错误,就可以开始安装Theano了。命令如下所示。
<code class="language-bash hljs  has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: 'Source Code Pro', monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;"><span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 安装Theano</span>
<span class="hljs-built_in" style="color: rgb(102, 0, 102); box-sizing: border-box;">sudo</span> pip install Theano

<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;"># 测试Theano</span>
python -c <span class="hljs-string" style="color: rgb(0, 136, 0); box-sizing: border-box;">"import theano;theano.test()"</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li><li style="box-sizing: border-box; padding: 0px 5px;">2</li><li style="box-sizing: border-box; padding: 0px 5px;">3</li><li style="box-sizing: border-box; padding: 0px 5px;">4</li><li style="box-sizing: border-box; padding: 0px 5px;">5</li></ul>

引用


使用anaconda2的时候出现问题,测试numpy一直有错误

Ubuntu14.04安装Theano详细教程

因为最近需要学习深度学习,因此想要配置Theano,来开发深度学习算法。但是发现Theano安装总是出现问题。于是在这里中总结一下。环境 操作系统:ubuntu14.04 Python:2.7.6 需...
  • xuezhisdc
  • xuezhisdc
  • 2015年11月19日 16:15
  • 32391

ubuntu14.04安装CUDA+theano

声明:     该服务器系统是ubuntu14.04 64bit     安装显卡驱动:(来源:http://blog.csdn.net/xizero00/article/details/43...
  • thy_2014
  • thy_2014
  • 2016年06月08日 17:37
  • 1260

Ubuntu14.04下安装CUDA&Theano

安装CUDA,THEANO等,前前后后遇到了不少问题,特别是对于Ubuntu新手来讲,很多时候都是不知所措的,所以只能多花时间搜集资料啦。另外由于实验室电脑配置也就那样,勉强装好这两个库,希望能帮到大...
  • Hanging_Gardens
  • Hanging_Gardens
  • 2017年03月21日 11:49
  • 678

ubuntu 14.04 下安装theano

首先ubuntu14.04,已经安装了python 2.7.6(这个最好你自己还是看一下) 自己一个人开始摸索机器学习,对于框架也没有什么概念,首先我们需要一个深度模型框架,theano就是这样的一...
  • vvickey11
  • vvickey11
  • 2016年09月28日 22:11
  • 1657

【炼成版】Ubuntu 14.04.3+CUDA 7.5+Theano 0.7 安装整理

从Windows7到Win+Ubuntu14.04双系统到安装CUDA,Theano。。话说工欲善其事,必先利其器。。经历了6天的潜心修炼,终于把我这器修炼成正果。。。。安装过程中真是被虐的不要不要的...
  • UncleMuses
  • UncleMuses
  • 2016年01月21日 23:41
  • 990

Ubuntu14.04安装Theano详细教程

本文转载自:http://blog.csdn.net/xuezhisdc/article/details/47065475 因为最近需要学习深度学习,因此想要配置Theano,来开发深度...
  • chivalrousli
  • chivalrousli
  • 2017年01月04日 14:30
  • 515

Ubuntu14.04-DeepLearning和Theano下配置GPU简便方法

  • 2015年06月04日 11:32
  • 117KB
  • 下载

Ubuntu14.04下安装Python2.7+Theano0.7+CUDA7.5

为了感受深度学习算法,从deeplearning.org上接触到了Python的Theano库,这是一个有透明GPU加速的算法库。最开始想在Windows上装的,但是折腾了一天没搞成,转而到Linux...
  • tomheaven
  • tomheaven
  • 2015年11月12日 23:29
  • 1698

ubuntu 16.04+Anaconda+theano+keras安装

ubuntu 16.04+Anaconda+theano+keras安装 安装软件部分浪费了好长时间才装好。之前一直各种问题,后来卸卸了radinka虚拟机,从头开始才终于弄好。 1,      ...
  • u013786021
  • u013786021
  • 2017年10月27日 22:44
  • 460

Caffe & Theano安装教程——ubuntu16.04系统

因为学习要用到深度学习,因此要配置caffe和theano。记过几日几夜的不懈奋战,最终找到了一种极为简单的安装方法。为将来要用到深度学习的同学节省时间,写下这个博客。由于博主是第一次写博客,若有错误...
  • yahag
  • yahag
  • 2016年07月20日 14:33
  • 3980
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Ubuntu14.04安装Theano详细教程
举报原因:
原因补充:

(最多只允许输入30个字)