When learning with Deep Learning, I am worried that it will take some time, so Currently, it is MXNet or CNTK that runs at high speed, so I tried to install MXNet. The original document is a little old, is that? Because there was a place I thought I wrote the procedure I built as a memorandum.
The latest version of the prebuild version of windows can be downloaded from the following site
https://github.com/yajiedesign/mxnet/releases
First, download the related library package of either vc12 or vc14.
Since python3.5 is built with vc14, select the vc14 base package (about 73MB) accordingly.
Next, download the prebuild version of the main unit. I think cuda is ready, so download the gpu version (about 18MB). Since it is compressed in 7z format, http://forest.watch.impress.co.jp/library/software/7zip/ Download the decompression tool.
The documentation says it expands to c: \ mxnet. I created and expanded the following folders as appropriate.
c:\work\mxnet
Deploy 7z for vc14 base package.
Was included. Looking at 3rdparty / cudnn / Readme.txt, it says that you should DL and place cudnn yourself. This time, set cudnn 5.1. By the way, if you look at 3rdparty / cudart /, it says cudart64_80.dll, so it will be a combination of CUDA8.0 64bit + cudnn 5.1 (updated depending on the downloaded version).
I downloaded the file and copied the extracted file under 3rdparty / cudnn.
Next, extract the 2017XXXX_mxnet_x64_vc14_gpu file Copy to prebuildbase_win10_x64_vc14. In the state so far
c:\work\mxnet\prebuildbase_win10_x64_vc14\
It has become.
The documentation says to run setupenv.cmd and install it with python / setup.py, but first assume it will be used in a virtual environment for mxnet.
Anaconda is convenient as a virtual environment for windows. You can download the full version, but if you want to install from the bare minimum, miniconda is a good choice. Due to the opencv package, the python used is ** 3.5 **.
The virtual environment name is specified with -n, and here it is mxnet (any option is acceptable). After that, specify version 3.5 with python = 3.5. numpy, scipy, cython are required, so set at installation time. ipython is easy to use for testing, so install it as well.
conda create -n mxnet python=3.5 numpy scipy cython ipython
It will be downloaded and installed to something like c: \ Anaconda3 \ envs \ mxnet.
If set successfully, from the command prompt that uses this virtual environment
activate mxnet
It becomes a state to use the virtual environment.
If you look at setupenv.cmd, the path setting to the 3rdparty folder will be added to your PATH. However, it fails if the PATH string already exceeds 1024.
Here, you need to add the absolute path of the following folders to the environment variable PATH.
In short, I created a script to set these PATHs. As a file called c: \ work \ mxnet \ mxnetenv.bat
set MXNET_HOME=c:\work\mxnet\prebuildbase_win10_x64\vc14
set MXNET_DEPEND=%MXNET_HOME%\3rdparty
set MXNET_PATH=%MXNET_DEPEND%\openblas\bin;%MXNET_DEPEND%\gnuwin;%MXNET_DEPEND%\vc;%MXNET_DEPEND%\opencv;%MXNET_DEPEND%\cudart;%MXNET_DEPEND%\cudnn\bin;%MXNET_HOME%\lib
set PATH=%MXNET_PATH%;%PATH%
Created. ** Reset MXNET_HOME to your own path **. If you want to use mxnet, start this mxnetenv.bat first.
At this point, you're ready to install it as a python package. It is written as expanded to c: \ work \ mxnet, but please read as appropriate.
activate mxnet
cd c:\work\mxnet
mxnetenv.bat
cd %MXNET_HOME%\python
python setup.py install
Meaning,
--Switch to the virtual environment python 3.5 mxnet you set up earlier --Move to the installed folder --Added mxnet's 3rdparty dependent library path to environment variable PATH --Move to python folder --Installed on site-package in virtual environment using setup.py
Then, the setting will start and the installation will be completed while downloading other missing libraries.
Now check if you have installed it. Start python in a virtual environment
import mxnet as mx
a = mx.nd.ones((2,3))
print((a*2).asnumpy())
If there is no error, it will be as follows (here, ipython was used)
(mxnet) c:\work\mxnet> ipython
In [1]: import mxnet as mx
In [2]: a = mx.nd.ones((2, 3));
In [3]: print ((a*2).asnumpy());
[[ 2. 2. 2.]
[ 2. 2. 2.]]
I installed OpenCV3 and jupyter because it's inconvenient to do anything.
conda install -c menpo opencv3
conda install jupyer matplotlib
(OpenCV3 packages are not standard. This is why we decided to use 3.5 as it is not currently distributed for python3.6)
jupyter-notebook
So, launch jupyter, create a new file with "New"-"Python3", and test whether the previous test command passes.
Also, in the MXNet tutorial, there is also a sample to draw a graph, so It is better to install graphviz in advance.
I think that you can now use the latest version of mxnet, but testing such as mnist is the next opportunity ...