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

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

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

2019-11-14 11:31:21
字體:
來源:轉載
供稿:網友

徐海蛟教學

一,安裝輕量級深度學習框架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
日本午夜精品理论片a级appf发布| 国产精品久久久久久久久久99| 成人免费视频网址| 亚洲精品欧美日韩| 91在线免费网站| 最近日韩中文字幕中文| 欧美激情视频网站| 91成人精品网站| 色哟哟亚洲精品一区二区| 国产欧美一区二区白浆黑人| 国产一区二区三区高清在线观看| 91高清免费在线观看| 中日韩美女免费视频网址在线观看| 亚洲网站视频福利| 95av在线视频| 国产精品久久97| 亚洲午夜久久久久久久| 色一区av在线| 欧美大片免费看| 日本国产高清不卡| 久久久久久久久电影| 日韩欧美综合在线视频| 久久乐国产精品| 日本成熟性欧美| 中文字幕日韩欧美精品在线观看| 日韩经典第一页| 欧美人在线观看| 久久久精品久久久| 亚洲日本成人网| 亚洲第一页在线| 国产日韩精品在线| 久久久久久久久久久av| 国产欧美一区二区三区视频| 91美女片黄在线观看游戏| 久久久免费精品| 欧美成aaa人片在线观看蜜臀| 欧美国产欧美亚洲国产日韩mv天天看完整| 92版电视剧仙鹤神针在线观看| 91黄色8090| 欧美一级电影久久| 亚洲人午夜色婷婷| 欧美日韩加勒比精品一区| 狠狠色香婷婷久久亚洲精品| 秋霞午夜一区二区| 91在线观看免费网站| 久久综合久中文字幕青草| 久久精品成人动漫| 欧美电影免费观看网站| 久久久国产一区二区| 国产视频福利一区| 国产噜噜噜噜噜久久久久久久久| 亚洲成年人影院在线| 国产精品网站入口| 亚洲一区二区三区视频| 国产又爽又黄的激情精品视频| 日本欧美一级片| 中文日韩在线观看| 亚洲自拍偷拍视频| 国产成人精品午夜| 欧美激情一区二区三区高清视频| 亚洲精品网址在线观看| 欧美黄色www| 精品久久久久久国产| 777777777亚洲妇女| 亚洲精品久久久一区二区三区| 91产国在线观看动作片喷水| 欧美大胆a视频| 亚洲一区二区三区久久| 亲爱的老师9免费观看全集电视剧| 精品一区二区三区四区| 91精品久久久久久| 国产男女猛烈无遮挡91| 狠狠爱在线视频一区| 91在线免费观看网站| 亚洲欧洲在线观看| 日韩精品在线私人| 亚洲欧洲美洲在线综合| 国产精品久久久久久久av大片| 欧美激情视频一区二区三区不卡| 精品中文字幕视频| 欧美高跟鞋交xxxxhd| 色偷偷av一区二区三区| 亚洲视频第一页| 亚洲色图第一页| 国产精品中文字幕在线| 国产精品久在线观看| 欧美激情精品久久久久久久变态| 米奇精品一区二区三区在线观看| 亚洲综合中文字幕在线观看| 欧美片一区二区三区| 欧美日韩国产影院| 国产精品香蕉在线观看| 亚洲成人激情小说| 久久综合亚洲社区| 久久夜色精品亚洲噜噜国产mv| 久久久综合av| 精品色蜜蜜精品视频在线观看| 日韩电影免费在线观看| 成人午夜激情免费视频| 91国语精品自产拍在线观看性色| 日韩一区av在线| 亚洲精品中文字幕有码专区| 久久亚洲精品小早川怜子66| 亚洲最大福利网| 欧美亚洲成人精品| 在线观看国产成人av片| 精品调教chinesegay| 国产午夜精品全部视频播放| 国产精品美女在线| 欧美激情一级欧美精品| 亚洲国产精品久久久久秋霞蜜臀| 亚洲精品ady| 亚洲第一页在线| 日韩女优在线播放| 国产精品亚洲一区二区三区| 亚洲成人av在线播放| 色老头一区二区三区在线观看| 97国产精品视频| 国产精品一二三在线| 色yeye香蕉凹凸一区二区av| 久久激情视频免费观看| 欧美高清在线观看| 久久免费视频在线| 亚洲精品久久久久久久久久久久久| 欧美在线观看网站| 97国产精品视频| 国产精品一区二区三区久久久| 岛国av一区二区| 精品成人69xx.xyz| 色综合老司机第九色激情| 国产一区二区黄| 亚洲欧美激情视频| 岛国av一区二区三区| 正在播放欧美视频| 久久久噜噜噜久噜久久| 国产精品美女www爽爽爽视频| 在线电影欧美日韩一区二区私密| 欧美视频在线观看免费| 欧美成人免费在线视频| 日韩精品视频观看| 国产精品极品在线| 久久精品视频播放| 日韩电影中文字幕| 亚洲欧美制服综合另类| 久热精品在线视频| 国产91精品不卡视频| 成人精品福利视频| 成人有码视频在线播放| 日韩精品中文字幕久久臀| 亚洲人成电影在线观看天堂色| 欧美巨乳在线观看| 久久精品91久久久久久再现| 亚洲女性裸体视频| 国产欧美日韩中文字幕在线| 91在线高清免费观看| 久久成人av网站| 成人激情电影一区二区| 成人黄色影片在线| 国产精品久久久久久久av电影| 国产精品无av码在线观看| 亚洲在线视频福利| 亚洲午夜精品久久久久久久久久久久| 欧美国产日韩一区二区在线观看| 欧美另类极品videosbestfree|