美文网首页
MXnet安装和编译

MXnet安装和编译

作者: gb_QA_log | 来源:发表于2018-03-27 15:50 被阅读0次

    根据install MXNet
    MXNet安装其实是从c++文件make编译成动态库到incubator-mxnet/lib/libmxnet.so,而incubator-mxnet/python其实是用python调用c++库的方法封装,然后用pip安装到python,之后example里面的文件就可以import mxnet as mx了。

    Linux-Python-CPU-Build from Source on Ubuntu安装。

    • 查看系统
    lsb_release -a
    
    • Minimum Requirements
      GCC版本:gcc -v
      GNU Make:已安装

    • Step 1 Install build tools and git.

    $ sudo apt-get update
    $ sudo apt-get install -y build-essential git
    
    • Step 2 Install OpenBLAS
    $ sudo apt-get install -y libopenblas-dev liblapack-dev
    
    • Step 3 Install OpenCV.
    $ sudo apt-get install -y libopencv-dev
    
    • Step 4 Download MXNet sources and build MXNet core shared library.
    $ git clone --recursive https://github.com/apache/incubator-mxnet
    $ cd incubator-mxnet
    $ make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas
    
    cd incubator-mxnet
    git submodule init
    git submodule update
    

    出错:src/nnvm/tvm_bridge.cc:37:37: fatal error: tvm/runtime/packed_func.h: No such file or directory

    git submodule update --init --recursive
    

    ps:make时间很长。

    • Build the MXNet Python binding
    sudo pip uninstall mxnet
    cd python
    pip install --upgrade pip
    sudo pip install -e .
    

    Linux-Python-CPU-Build from Source on CentOS, Multi-Machines安装。

    • 配置MXNet在各个node上
    sudo yum install build-essential git
    sudo yum install lapack-devel openblas-devel opencv-devel
    git clone --recursive https://github.com/apache/incubator-mxnet
    cd incubator-mxnet
    make clean_all
    make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_DIST_KVSTORE=1   USE_PROFILER=1 
    
    sudo pip uninstall mxnet
    cd python
    sudo pip install --upgrade pip
    sudo pip install -e .
    

    分布式安装及运行

    MXNet运行(分布式+动态库)

    相关文章

      网友评论

          本文标题:MXnet安装和编译

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