美文网首页CAFFE
pycaffe安装过程中问题集锦

pycaffe安装过程中问题集锦

作者: 生活科技 | 来源:发表于2018-01-11 14:23 被阅读2次

    1.caffe 上OpenBLAS的安装使用
    BLAS是一个数学函数接口标准,有很多个实现。按照Caffe官方ubuntu的安装文档默认安装的是ATLAS。这个版本的BLAS不能利用多核CPU,我们将其换为OpenBLAS,可以利用多核CPU并行计算,加快Caffe的分类速度。
    源代码安装配置OpenBLAS
    -git代码到本地并安装

    git clone https://github.com/xianyi/OpenBLAS.git
    cd OpenBLAS
    make -j4
    make install
    

    -修改Caffe的Makefile.config

    BLAS_INCLUDE :=  /opt/OpenBLAS/include
    BLAS_LIB := /opt/OpenBLAS/lib
    

    -caffe重新make

    make clean
    
    make pycaffe
    
    make all -j6
    
    make test && runtest
    

    在caffe安装好后,编译时要指定Makefile.config

    # BLAS choice:
    # atlas for ATLAS (default)
    # mkl for MKL
    # open for OpenBlas
    BLAS := open
    # Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
    # Leave commented to accept the defaults for your choice of BLAS
    # (which should work)!
    BLAS_INCLUDE := /usr/local/OpenBlas/include
    BLAS_LIB := /usr/local/OpenBlas/lib
    

    在runtest时会报一个错::error while loading shared libraries: libopenblas.so.0: cannot open shared object file: No such file or directory.
    解决方法:在/usr/lib/下建立一个 软链接将 libopenblas.so.0指向/openbls安装目录/lib/ libopenblas.so.0

    sudo ln -s /opt/OpenBLAS/lib/libopenblas.so.0 /usr/lib/libopenblas.so.0
    

    相关文章

      网友评论

        本文标题:pycaffe安装过程中问题集锦

        本文链接:https://www.haomeiwen.com/subject/lrgznxtx.html