MXnet安装和编译

2018-03-27  本文已影响0人  gb_QA_log

根据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
$ sudo apt-get update
$ sudo apt-get install -y build-essential git
$ sudo apt-get install -y libopenblas-dev liblapack-dev
$ sudo apt-get install -y libopencv-dev
$ 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时间很长。

sudo pip uninstall mxnet
cd python
pip install --upgrade pip
sudo pip install -e .

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

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运行(分布式+动态库)

上一篇下一篇

猜你喜欢

热点阅读