最近幾個月在學習Deep Learning,剛開始的時候甚么條件都不具有。自己從淘寶上面買了1個GT 240,搭建1個GPU環境用于程序的調試。折騰了幾個月,之前PyCUDA總是搭建失敗,最近幾天才嘗試成功。為了學習Deep Learning的源代碼,自己又搭建了Theano環境。由于時間緊張,自己概略總結以下,以備忘記。
1. 在Windows上安裝PyCUDA
1. 安裝條件
(1) pytools庫
安裝PyCUDA還需要pytools庫,而pytools庫又需要six,appdirs,decorator這3個庫[easy_install]。
(2) boost庫
難點在于安裝boost庫,便可以自己用VS 2010編譯,也能夠直接使用他人編譯好的。自己用的是他人編譯好的。
2. 安裝Microsoft Visual C++ Compiler for Python 2.7
3. 安裝PyCUDA
(1) 履行configure.py
(2) 編輯siteconf.py
(3) 編譯和安裝PyCUDA
解析:python setup.py build;python setup.py install
說明:終究運行PyCUDA中自帶的實例demo.py,顯示正確結果則表示安裝成功。
2. 在Windows上安裝Theano
1. 配置CUDA
解析:
(1) 安裝顯卡驅動,CUDA Toolkit和CUDA SDK(已集成)。
(2) VS 2010和Visual Assist X。
2. 安裝Python(x,y)
3. 安裝Theano
解析:easy_install theano
4. 創建theanorc.txt文件
解析:
在C:Usersxxx>下面創建theanorc.txt文件,以下所示:
5. 測試Theano
解析:
import theano;theano.test()
說明:
最后要在目錄D:Program Files (x86)Microsoft Visual Studio 10.0VCinclude添加inttypes.h和stdint.h這兩個文件。然后就能夠運行Deep Learning Tutorial中的例子。
參考文獻:
[1] Theano的艱辛安裝體驗:http://www.cnblogs.com/hanahimi/p/4127026.html
[2] Windows 7系統安裝Cuda 5.0/5.5:http://jingyan.baidu.com/article/29697b9132e72eab21de3c76.html
[3] 風辰的CUDA入門教程:http://wenku.baidu.com/view/bdcac5260722192e4536f6da.html
[4] Win7下CUDA 5.0 + VS2010環境配置:http://wenku.baidu.com/view/6ec6b17402768e9951e738d6.html
[5] PyCUDA的Windows開發環境搭建:http://blog.csdn.net/xuanyuansen/article/details/41926933
[6] Windows下搭建GPU編程環境:http://www.docin.com/p⑷11000885.html
[7] windows下編譯boost庫:http://blog.csdn.net/zhanhuai1/article/details/7232995
[8] boost庫的安裝與編譯教程:http://jingyan.baidu.com/article/642c9d34c198bd644a46f70f.html
[9] Windows下編譯和安裝Boost庫的指定模塊:http://grow.sinaapp.com/?p=1155
[10] Boost C++ Libraries:http://sourceforge.net/projects/boost/files/boost-binaries/1.55.0/
[11] DeepLearning 0.1 documentation:http://deeplearning.net/
上一篇 c/c++中的const
下一篇 git版本回退的一個問題