亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

Ubuntu14.04上輕松安裝與優化輕量級深度學習框架Theano[轉]

2019-11-14 12:26:48
字體:
來源:轉載
供稿:網友

徐海蛟教學

一,安裝輕量級深度學習框架Theano

Warning

If you want to install the bleeding-edge or development version of Theano from GitHub, please make sure you are reading the latest version of this page.

For Ubuntu 11.10 through 14.04:

sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose g++ libopenblas-dev gitsudo pip install Theano

Note

If you have error that contain “gfortran” in it, like this one:

ImportError: (‘/home/Nick/.theano/compiledir_linux-2.6.35-31-generic-x86_64-with-Ubuntu-10.10-maverick–2.6.6/tmpIhWJaI/0c99c52c82f7ddc775109a06ca04b360.so: undefined symbol: _gfortran_st_write_done’

The PRoblem is probably that NumPy is linked with a different blas then one currently available (probably ATLAS). There is 2 possible fixes:

Uninstall ATLAS and install OpenBLAS.Use the Theano flag “blas.ldflags=-lblas -lgfortran”

1) is better as OpenBLAS is faster 

then ATLAS and NumPy is probably already linked with it. So you won’t need any other change in Theano files or Theano configuration.

Note

We use pip for 2 reasons. First, it allows “import module; module.test()” to work correctly. 

Second, the installation of NumPy 1.6 or 1.6.1 with easy_install raises an ImportError at the end of the installation. To my knowledge we can ignore this error, but this is not completely safe.easy_install with NumPy 1.5.1 does not raise this error.

Bleeding Edge Installs

If you would like, instead, to install the bleeding edge Theano (from github) such that you can edit and contribute to Theano, replace the pip install Theano command with:

git clone git://github.com/Theano/Theano.gitcd Theanopython setup.py develop --usercd ..

Test the newly installed packages

NumPy (~30s): python -c "import numpy; numpy.test()"SciPy (~1m): python -c "import scipy; scipy.test()"Theano (~30m): python -c "import theano; theano.test()"

二,優化輕量級深度學習框架Theano

Speed test Theano/BLAS

It is recommended to test your Theano/BLAS integration. There are many versions of BLAS that exist and there can be up to 10x speed difference between them. Also, having Theano link directly against BLAS instead of using NumPy/SciPy as an intermediate layer reduces the computational overhead. This is important for BLAS calls to gergemv and small gemm Operations (automatically called when needed when you use dot()). To run the Theano/BLAS speed test:

python `python -c "import os, theano; print(os.path.dirname(theano.__file__))"`/misc/check_blas.py

This will print a table with different versions of BLAS/numbers of threads on multiple CPUs and GPUs. It will also print some Theano/NumPy configuration information. Then, it will print the running time of the same benchmarks for your installation. Try to find a CPU similar to yours in the table, and check that the single-threaded timings are roughly the same.

Theano should link to a parallel version of Blas and use all cores when possible. By default it should use all cores. Set the environment variable “OMP_NUM_THREADS=N” to specify to use N threads.

Note

It is possible to have a faster installation of Theano than the one these instructions provide, but this will make the installation more complicated and/or may require that you buy software. This is a simple set of installation instructions that will leave you with a relatively well-optimized version that uses only free software. With more work or by investing money (i.e. buying a license to a proprietary BLAS implementation), it is possible to gain further performance.

Updating Theano

If you followed these installation instructions, you can execute this command to update only Theano:

sudo pip install --upgrade --no-deps theano

If you want to also installed NumPy/SciPy with pip instead of the system package, you can run this:

sudo pip install --upgrade theano

Updating Bleeding Edge Installs

Change to the Theano directory and run:

git pull

Manual Openblas instruction

The openblas included in some older Ubuntu version is limited to 2 threads. Ubuntu 14.04 do not have this limit. If you want to use more cores at the same time, you will need to compile it yourself. Here is some code that will help you.

# remove openblas if you installed itsudo apt-get remove libopenblas-base# Download the development version of OpenBLASgit clone git://github.com/xianyi/OpenBLAScd OpenBLASmake FC=gfortransudo make PREFIX=/usr/local/ install# Tell Theano to use OpenBLAS.# This works only for the current user.# Each Theano user on that computer should run that line.echo -e "/n[blas]/nldflags = -lopenblas/n" >> ~/.theanorc

Contributed GPU instruction

Basic configuration for the GPU Using the GPU.

Ubuntu 14.04:

sudo apt-get install nvidia-currentsudo apt-get install nvidia-cuda-toolkit # As of October 31th, 2014, provide cuda 5.5, not the latest cuda 6.5

If you want cuda 6.5, you can download packages from nvidia for Ubuntu 14.04.

If you downloaded the run package (the only one available for CUDA 5.0 and older), you install it like this:

chmod a+x XXX.shsudo ./XXX.sh

Since CUDA 5.5, Nvidia provide a DEB package. If you don’t know how to intall it, just double click on it from the graphical interface. It should ask if you want to install it. On Ubuntu 14.04, you need to run this in your terminal:

sudo apt-get updatesudo apt-get install cuda

You must reboot the computer after the driver installation. To test that it was loaded correctly after the reboot, run the command nvidia-smi from the command line.

Test GPU configuration

THEANO_FLAGS=floatX=float32,device=gpu python /usr/lib/python2.*/site-packages/theano/misc/check_blas.py

Note

Ubuntu 14.04: default gcc version 4.8.2, gcc 4.4.7,, 4.6.4, and 4.7.3 available.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
亚洲日本中文字幕| 26uuu亚洲伊人春色| 最近中文字幕mv在线一区二区三区四区| 国产成人拍精品视频午夜网站| 午夜精品久久久久久久99热| 国产精品亚洲网站| 欧美精品激情在线| 国产精品视频网| 麻豆一区二区在线观看| 欧美色欧美亚洲高清在线视频| 亚洲午夜精品久久久久久性色| 欧美夜福利tv在线| 欧美日韩久久久久| 午夜精品美女自拍福到在线| 91在线观看免费高清完整版在线观看| 91老司机在线| 日韩av中文在线| 精品自拍视频在线观看| 亚洲黄在线观看| 亚洲精品成人久久久| 欧美日韩一区二区三区在线免费观看| 97久久久免费福利网址| 欧美精品video| 亚洲国语精品自产拍在线观看| 成人av资源在线播放| 欧美裸体xxxx极品少妇| 伊人久久久久久久久久| 国产91色在线免费| 午夜精品理论片| 日韩av网站电影| 欧美视频在线观看免费网址| 精品中文字幕乱| 视频一区视频二区国产精品| 色香阁99久久精品久久久| 欧美日韩成人精品| 亚洲最新av网址| 91av在线播放| 亚洲国产天堂网精品网站| 激情成人中文字幕| 亚洲日本欧美日韩高观看| 亚洲欧美999| 国产精品日韩在线一区| 国产精品欧美日韩| 欧美成人黑人xx视频免费观看| 成人亚洲欧美一区二区三区| 92福利视频午夜1000合集在线观看| 国产成人精品一区二区在线| 亚洲人成电影在线| 国产精品18久久久久久首页狼| 亚洲自拍欧美色图| 久久久精品999| 亚洲第一精品夜夜躁人人爽| 综合av色偷偷网| 7m第一福利500精品视频| 最新国产精品拍自在线播放| 国产91色在线播放| 亚洲精品福利资源站| 欧美日韩xxxxx| 久久久久久网站| 亚洲精品视频在线观看视频| 亚洲美女动态图120秒| 久久精品国产欧美激情| 色播久久人人爽人人爽人人片视av| 欧洲成人午夜免费大片| 永久555www成人免费| 中文字幕久精品免费视频| 国产一区二区三区丝袜| 国产精品揄拍一区二区| 福利微拍一区二区| 日韩av片免费在线观看| 精品偷拍一区二区三区在线看| 亚洲女人天堂视频| 亚洲最大福利网| 国产成人鲁鲁免费视频a| 久久伊人色综合| 精品国产一区二区三区四区在线观看| 久久免费成人精品视频| 欧美精品久久久久久久免费观看| 日韩欧美在线中文字幕| 久久久久久这里只有精品| 亚洲大胆人体在线| 国内精品美女av在线播放| 91国产在线精品| 色综久久综合桃花网| 日韩精品在线观看网站| 精品福利免费观看| 日本中文字幕成人| 亚洲黄色www网站| 浅井舞香一区二区| 亚洲淫片在线视频| 欧洲亚洲在线视频| 日韩中文字幕视频| 日韩精品视频在线播放| 欧美成人亚洲成人日韩成人| 大伊人狠狠躁夜夜躁av一区| 日韩欧美精品网址| 欧美一级视频免费在线观看| 欧美精品一本久久男人的天堂| 97精品国产97久久久久久春色| 欧美一级电影久久| 日韩有码片在线观看| 日韩精品在线免费播放| 亚洲精品美女在线观看播放| 欧美激情a在线| 国产91精品青草社区| 日本欧美一二三区| 77777亚洲午夜久久多人| 在线观看国产成人av片| 一本久久综合亚洲鲁鲁| 久久亚洲精品国产亚洲老地址| 欧美性生交xxxxx久久久| 国产91在线播放| 性色av一区二区三区免费| 日韩中文字幕在线视频| 国产精品久久中文| 欧美视频一区二区三区…| 4388成人网| 97热在线精品视频在线观看| 日韩欧美国产中文字幕| www.美女亚洲精品| 欧美激情影音先锋| 欧美激情在线有限公司| 神马国产精品影院av| 色伦专区97中文字幕| 日韩视频在线一区| 日韩激情视频在线播放| 日本久久久久久久久久久| 91国产视频在线| 伊人亚洲福利一区二区三区| 精品国产999| 国产精品户外野外| 中文字幕欧美日韩在线| 日韩不卡中文字幕| 国产精品v日韩精品| 欧美另类xxx| 亚洲天堂av在线播放| 中文字幕亚洲精品| 国产精品久久久久久久电影| 在线播放日韩欧美| 亚洲在线观看视频| 欧美成人免费小视频| 久久理论片午夜琪琪电影网| 98精品国产高清在线xxxx天堂| 麻豆国产va免费精品高清在线| 欧美成人精品影院| 国产精品极品在线| 一区二区三区视频在线| 亚洲理论在线a中文字幕| 一色桃子一区二区| 欧美xxxwww| 精品视频—区二区三区免费| 久久久亚洲影院你懂的| 自拍偷拍亚洲一区| 欧美日产国产成人免费图片| 国产日韩一区在线| 国产精品夜色7777狼人| 欧美体内谢she精2性欧美| 国产精品999999| 国产综合视频在线观看| 欧美日韩亚洲91| 日韩电影在线观看永久视频免费网站| 国产成人一区二区三区小说| 久久久www成人免费精品张筱雨| 亚洲欧美在线播放|