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"]
docker build -t mxnet-tutorials .
docker run\
-v $(pwd):/home/mxnet/mxnet-tutorials\
-p 8888:8888\
--rm\
mxnet-tutorials
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)
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