根据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
- 查看:issues
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 .
网友评论