为什么 OpenBLAS Lapack 在 Theano Windows 中不可用?

Why OpenBLAS Lapack not Available in Theano Windows?

我正在使用 Windows 10 64 位,并且已经安装了 theano。我已经从 http://sourceforge.net/projects/openblas/files/v0.2.15/OpenBLAS-v0.2.15-Win64-int32.zip/download 下载 OpenBLAS,并将 libopenblas.dll 放入 minGW64_dllC:\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 的新手所以我希望这里的任何人都可以帮助我, 谢谢

我不认为 Theano 直接使用 OpenBLAS,我认为它只是通过 numpy 使用它。所以你需要配置 numpy 来使用 OpenBLAS。在 Windows.

上这似乎不是一件容易的事

See this thread for example.

Theano 的 check_blas.py 脚本正在打印您的 numpy 配置。该配置似乎都是为使用 MKL 而设置的。如果您安装了 MKL(并获得了适当的许可),那么您就不需要 OpenBLAS。

如果您没有安装 MKL,尽管有 numpy 配置,OpenBLAS 的替代方法是使用 Anaconda 的 MKL 扩展。这是一个商业产品,但学生和非商业研究人员可以免费获得许可证。