MXNet-Ubuntu installation

MXNet-Installation#

Based on Ubuntu14.04/16.04, Python, GPU, Build from Sources

Prerequisites

export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:$LD_LIBRARY_PATH

Compile MXNnet core library##

Compile MXNet core shared library-libmxnet.so from C++ source code.

Minimum Requirements:

# 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

# 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/dmlc/mxnet
$ cd mxnet
$ make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1

Compile MXNet's Python API

# Step 1 Install prerequisites - python setup tools and numpy.
$ sudo apt-get install -y python-dev python-setuptools python-numpy

# Step 2 Build the MXNet Python binding.
$ cd python
$ sudo python setup.py install

# Step 3 Validate the installation by running simple MXNet code.
>>> import mxnet as mx
>>> a = mx.nd.ones((2,3), mx.gpu()) #Create a 2×3 matrix on the GPU
>>> b = a *2+1 #Each element of matrix a×2+1>>> b.asnumpy()array([[3.,3.,3.],[3.,3.,3.]], dtype=float32)

Recommended Posts

MXNet-Ubuntu installation
2019-07-09 CentOS7 installation
centos7_1708 installation
Centos5 installation guide
UBUNTU 16.04 installation diary
Python2.7 [Installation Tutorial]
ubuntu 1804 installation details
Python - centos6 installation
Docker installation (CentOS7 installation)
Python Anaconda installation
Ubuntu system installation
CentOS7 docker installation
Ubuntu installation record
ubuntu 18.04 installation (UEFI+GBT)
ubuntu installation error
ubuntu-server system installation