2015-11-16 48 views
0

我使用Windows 10 64位,並已安裝theano。我從下載OpenBLAS:http://sourceforge.net/projects/openblas/files/v0.2.15/OpenBLAS-v0.2.15-Win64-int32.zip/downloadminGW64_dll以及爲什麼OpenNAAS Lapack不能在Theano Windows中使用?

把libopenblas.dll在 C:\openblas and other dll文件

.theanorc文件:

[global] 
floatX = float32 
device = gpu 

[nvcc] 
flags= -LC:\Anaconda2\libs 
compiler_bindir= C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin 

[blas] 
ldflags= -LC:\\openblas -lopenblas 

,當我嘗試運行C:\Anaconda2\Lib\site-package\theano\misc\check_blas.py

我有這樣的事情:

... 
lapack_opt_info: 
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd', 'mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd'] 
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64'] 
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)] 
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include'] 
blas_opt_info: 
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd'] 
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64'] 
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)] 
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include'] 
openblas_lapack_info: 
    NOT AVAILABLE 
lapack_mkl_info: 
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd', 'mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd'] 
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64'] 
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)] 
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include'] 
blas_mkl_info: 
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd'] 
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64'] 
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)] 
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include'] 
mkl_info: 
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd'] 
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64'] 
    define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)] 
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include'] 
... 

我不明白,但寫有:

openblas_lapack_info: 
    NOT AVAILABLE 

它正確嗎?或者是錯誤?

我嘗試打印LDFLAGS使用命令

print('blas.ldflags=', theano.config.blas.ldflags) 

而且我覺得我得到了正確的輸出

('blas.ldflags=', '-LC:\\openblas -lopenblas') 

那麼,爲什麼當我測試使用check_blas.py我openblas狀態不可用?

我在Theano是新,所以我希望這裏有人能幫助我, 謝謝

回答

1

我不認爲Theano直接使用OpenBLAS,我認爲這隻能通過numpy的使用它。所以你需要配置numpy來使用OpenBLAS。在Windows上這似乎不是一件容易的事。

See this thread for example

您的numpy配置正在由Theano的check_blas.py腳本打印。該配置似乎都是爲使用MKL而設置的。如果您安裝了MKL(並獲得了適當的許可),那麼您不需要OpenBLAS。

如果您尚未安裝MKL,儘管numpy的配置,以OpenBLAS一種替代方法是使用Anaconda的MKL擴展。這是一個商業產品,但許可證是免費的學生和非商業的研究人員。

相關問題