如何使我的Numpy / Scipy使用ATLAS而不是OpenBLAS(在虚拟环境中)?

时间:2017-10-06 13:11:24

标签: python numpy scipy scikit-learn python-multiprocessing

我的numpy和scipy使用OpenBLAS,这导致了scikit-learn的多处理问题。 scikit-learn高级安装instructions表示应该使用ATLAS而不是OpenBLAS。我不知道如何使用ATLAS代替OpenBLAS进行numpy / scipy。我尝试了如下的说明,但仍然numpy配置说它使用OpenBLAS。我也试过this,但是numpy,scipy仍然使用OpenBLAS并且代码冻结了。更新替代命令清楚地显示选定的地图集,所以我不明白为什么numpy和scipy配置仍然显示正在使用OpenBLAS。我正在使用Ubuntu" 16.04.3 LTS(Xenial Xerus)"环境。

(.env) kai:~/work$ sudo update-alternatives --config libblas.so.3
There are 2 choices for the alternative libblas.so.3 (providing /usr/local/lib/libblas.so.3).

  Selection    Path                                    Priority   Status
------------------------------------------------------------
* 0            /usr/lib/atlas-base/atlas/libblas.so.3   100       auto mode
  1            /usr/lib/atlas-base/atlas/libblas.so.3   100       manual mode
  2            /usr/lib/libblas/libblas.so.3            10        manual mode

Press <enter> to keep the current choice[*], or type selection number: ^C
(.env) kai:~/work$ sudo update-alternatives --config libblas.so
There are 2 choices for the alternative libblas.so (providing /usr/local/lib/libblas.so).

  Selection    Path                                  Priority   Status
------------------------------------------------------------
* 0            /usr/lib/atlas-base/atlas/libblas.so   100       auto mode
  1            /usr/lib/atlas-base/atlas/libblas.so   100       manual mode
  2            /usr/lib/libblas/libblas.so            10        manual mode



>>> import numpy as np
>>> np.__config__.show()
lapack_opt_info:
    libraries = ['openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
blas_opt_info:
    libraries = ['openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
openblas_info:
    libraries = ['openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
openblas_lapack_info:
    libraries = ['openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
blas_mkl_info:
  NOT AVAILABLE

(.env) kai:~/work$ dpkg -l \*blas\* | grep ^i
ii  libblas-common 3.6.0-2ubuntu2 amd64        Dependency package for all BLAS implementations
ii  libblas-dev    3.6.0-2ubuntu2 amd64        Basic Linear Algebra Subroutines 3, static library
ii  libblas3       3.6.0-2ubuntu2 amd64        Basic Linear Algebra Reference implementations, shared library

0 个答案:

没有答案