[PYTHON] Environment construction for MXNet tutorial (gluon part)

TL;DR

-MXNet Tutorials Building neural networks imperatively with gluon Introduction of Dockerfile + startup method to expose the part -Official installation method + Jupyter environment --How to get rid of as of July 17, 2017, Official Docker image is more suitable when gluon is included in the release in the future Be careful because it is a loss --Using Python3, the Beginr part was okay with this.

** [2017/07/26 postscript] ** The above tutorial using gluon has been lowered from the official one, and it seems that it will be hosted at http://thestraightdope.mxnet.io.

Dockerfile

FROM ubuntu:16.04 

RUN groupadd mxnet && useradd -m -g mxnet mxnet
RUN apt-get update && apt-get install -y\
    build-essential\
    git\
    libopenblas-dev\
    liblapack-dev\
    libopencv-dev\
    python3-dev\
    python3-setuptools\
    python3-numpy\
    python3-pip\
    graphviz

#MXNet installation
RUN git clone --recursive https://github.com/dmlc/mxnet
WORKDIR mxnet
RUN make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas
WORKDIR /mxnet/python
RUN pip3 install --upgrade pip
RUN pip3 install -e .

RUN pip3 install \
    jupyter \
    matplotlib \
    graphviz
    #Python3 environment execution

RUN mkdir /home/mxnet/mxnet-tutorials
RUN chown -R mxnet:mxnet /home/mxnet
WORKDIR /home/mxnet/mxnet-tutorials

EXPOSE 8888
USER mxnet

CMD ["/usr/local/bin/jupyter", "notebook",\
    "--notebook-dir=/home/mxnet/mxnet-tutorials",\ 
    "--ip='*'",\
    "--port=8888",\ 
    "--no-browser"]

Startup procedure

  1. Build docker environment in advance (see docker site etc.)
  2. Place the Dockerfile in the current directory
  3. Build
docker build -t mxnet-tutorials .
  1. Start up
docker run\
  -v $(pwd):/home/mxnet/mxnet-tutorials\
  -p 8888:8888\
  --rm\
  mxnet-tutorials 
  1. When you access the browser to the displayed localhost: 8888 /? token = ..., Jupyter is running (haz)

Why In 0.10.0 released as of July 17, 2017, Tutorial .io / tutorials / index.html # high-level-interface-gluon) could not be executed and built (official Docker image is also v0.10.0)

What is gluon?

Gluon Package

Gluon package is a high-level interface for MXNet designed to be easy to use while keeping most of the flexibility of low level API. Gluon supports both imperative and symbolic programming, making it easy to train complex models imperatively in Python and then deploy with symbolic graph in C++ and Scala.

A package that provides a high-level interface (it's still experimental, so it's subject to change ... if you don't put it on the tutorial top)

In this tutorial, I also use a package (ʻautograd`) that automatically calculates the gradient at runtime like PyTorch, but this is also not supported by 0.10.0 (it is misleading and deep). It seems that it is placed in the position ...), so as of July 17, 2017, it seems that it is necessary to build from the master branch.

The tutorial is also rough, with typo here and there, and it seems likely that it will change. Please be careful if you try it.

Recommended Posts

Environment construction for MXNet tutorial (gluon part)
Python environment construction For Mac
Python3 environment construction (for beginners)
Ansible environment construction For Mac
[For beginners] Django -Development environment construction-
Python3 TensorFlow for Mac environment construction
Deep learning tutorial from environment construction
Python project environment construction procedure (for windows)
Construction of development environment for Choreonoid class
Django environment construction
DeepIE3D environment construction
Emacs-based environment construction
Linux environment construction
Python environment construction
Environment construction (python)
django environment construction
Cloud9 environment construction for developing serverless web applications
EV3 x Pyrhon Machine Learning Part 1 Environment Construction
Kotlin / Native development environment construction & installation procedure & tutorial
python environment construction
Pillow environment construction --For Docker + iPython (and OpenCV)
Python --Environment construction
Python environment construction
Golang environment construction
Word2vec environment construction
Web application made with Python3.4 + Django (Part.1 Environment construction)
[Python] Django environment construction (pyenv + pyenv-virtualenv + Anaconda) for macOS
Environment construction: GCP + Docker
Django project environment construction
python windows environment construction
Go language environment construction
ConoHa environment construction memo
homebrew python environment construction
[For memo] Linux Part 2
PyData related environment construction
Anaconda-4.2.0-python3 environment construction (Mac)
Python development environment construction
YOLO v4 environment construction ①
pyenv + fish environment construction
python2.7 development environment construction
BigGorilla environment construction memo
grip environment construction onCentOS6.5
FastAPI Tutorial Memo Part 1
Anaconda environment construction memo
Golang environment construction [goenv]
Mac environment construction Python
Pyxel environment construction (Mac)
Python environment construction @ Win7
Python environment for projects
From environment construction to deployment for flask + Heroku with Docker
Environment construction, simple confirmation and skill test for each language
Construction of Cortex-M development environment for TOPPERS using Raspberry Pi