theano installation documentation指出,如果“BLAS库可作为可动态加载的库使用”,则theano将默认使用numpy中的BLAS库。这似乎在我的机器上不起作用,请参阅错误消息。

  • 我如何确定numpy BLAS库是否可以动态加载?
  • 如果无法动态加载numpy BLAS库,我该如何重新编译它们?

  • 请指出是否需要更多信息!

    错误消息
    We did not found a dynamic library into the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library./usr/bin/ld: cannot find -lblas
    附录

    theano库需要numpy和BLAS库。我认为numpy是BLAS附带的,如果您在Ubuntu下使用 sudo apt-get install python-numpy python-scipy 安装它。

    这是/usr/lib64/python2.6/dist-packages/scipy/lib/blas的文件列表
    cblas.so  info.py   __init__.py   scons_support.py   setup.py
    fblas.so  info.pyc  __init__.pyc  scons_support.pyc  setup.pyc
    setupscons.py  test
    setupscons.pyc
    

    这是distutils.__config__.show()的输出如下
    blas_info:
        libraries = ['blas']
        library_dirs = ['/usr/lib64']
        language = f77
    
    lapack_info:
        libraries = ['lapack']
        library_dirs = ['/usr/lib64']
        language = f77
    
    atlas_threads_info:
      NOT AVAILABLE
    
    blas_opt_info:
        libraries = ['blas']
        library_dirs = ['/usr/lib64']
        language = f77
        define_macros = [('NO_ATLAS_INFO', 1)]
    
    atlas_blas_threads_info:
      NOT AVAILABLE
    
    lapack_opt_info:
        libraries = ['lapack', 'blas']
        library_dirs = ['/usr/lib64']
        language = f77
        define_macros = [('NO_ATLAS_INFO', 1)]
    
    atlas_info:
      NOT AVAILABLE
    
    lapack_mkl_info:
      NOT AVAILABLE
    
    blas_mkl_info:
      NOT AVAILABLE
    
    atlas_blas_info:
      NOT AVAILABLE
    
    mkl_info:
      NOT AVAILABLE
    

    最佳答案

    下载python库的Anaconda发行版后,我刚刚在64位Ubuntu 12.04 LTS上遇到了相同的问题。将Theano指向包含libblas.so的目录已处理完毕。
    $ THEANO_FLAGS=blas.ldflags="-L/usr/lib/ -lblas" python rbm.py

    关于linux - 如何确保numpy BLAS库可用作动态可加载库?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6789368/

    10-12 17:03