by

Installing or upgrading to MXNet version 0.12.1 on Windows 10

This post is a continuation and somewhat a revision of  “Installing MXNet on Windows 10”

MXNet is evolving and recently there was a release of version 0.12

I want to share the upgrade process that worked for me on my Windows 10 machine. You can use this tutorial as installation tutorial of MXNet 0.12

First, we will need to create a folder somewhere called mxnet-0.12, I’ve placed mine on the D drive, so I have

After we have a folder for the installation, lets go to https://github.com/yajiedesign/mxnet/releases and download two packages:

  1. VC14 – vc14 v2 base package
  2. GPU ( or CPU) pre-built package – at the moment of writing it was 20171127_mxnet_x64_vc14_gpu_cu80.7z

Unpack VC14 v2 first in the mxnet-0.12 folder and after that do the same with the GPU archive.

If you are using GPU version of MXNet, you will need to add CUDAlibraries to the folder called 3rd party.

You can register at NVIDIA web-site and get required cuDNN  library for free. You will need to use

CUDA 8 / cuDNN v5.1 Library for Windows 10

The file should be placed into:

Drive:\mxnet-0.12\3rdparty\cudnn\bin\

Now in the root of the mxnet-0.12 folder look for a file called setupenv.cmd and run it as Administrator.

This execution of the .cmd file should adjust the PATH, and add MXNET_HOME environment variable.

MXNET_HOME should just point to the location of the mxnet-0.12 folder.

When all above is done, activate either Python 3.6 or Python 2.7 64-bit environment of your choice – Anaconda, virtualenv or Python binary native to the operating system.

Usually you do that by issuing command source activate [environment name] In my case, it is just source activate mxnet which I’ve created earlier using Anaconda Python 3.6 64bit installation.

Once the environment is active, go to the MXNET_HOME\python and run

python setup.py install

It should upgrade or install your MXNet package. Enjoy!

Write a Comment

Comment

  1. Hi,I’ve installed anaconda3 andpy3,so I create an environment for py2 named”mxnet”.And I followed the steps in the passage,but I find I can only import mxnet successfully when I activate “mxnet” environment and go to the folder “D:\mxnet\python”.I can not import mxnet in other folder.It really confused me when I use jupyter but I can’t import mxnet.I’m not sure is there any solution for that?

    • While in command line, you can activate python environment, and then run python interpreter. Activation of an environment makes sure when you run python command, the python binary will be picked from the environment folder.
      So if you are in any other folder, activate mxnet environment and run python interpreter. It should be able to import mxnet.
      As for the Jupyter, if you want to use MXNet in a notebook, you need to perform a few steps:
      1. Open Anaconda Navigator
      2. Go to Environments tab, find mxnet environment, and there you can open open it with Jupyter Notebook

  2. I followed the steps you discussed.
    (Small difference: I did not create a separate environment in Anaconda since installing mxnet into the root itself is fine for me. )
    Within the Anaconda prompt, I went to C:\MXNet\python and ran “python setup.py install”. That ran fine. It displayed a bunch of messages about copying files, updating dependencies etc. There were no error messages. So, from all the appearance, installing MXNet into Anaconda environment finished fine.

    After that, I ran Python and issued the command “import mxnet”. This failed saying “The specified module could not be found”. I wonder why. It looks like this is the same problem “CC” mentioned in the comment above as well.
    Thanks.

      • (1) If we do that (i.e., manually copying the folder), is it still necessary to do the other installation steps mentioned in your blog above?
        (2) Can you please indicate the path on your machine where you copied the mxnet folder into so that I can find the equivalent folder on my machine? On my machine, Anaconda installation path is “c:\users\myname\AppData\Local\Continuum\anaconda3”. I only see a folder named “pkgs” there and not anything named “site-packages” at that level (Well, at lower levels, different installed packages such as pyflakes, pycropto, pyparsing etc. have their own site-packages folders.)

        Thank you!

        • Hi Victory,
          1 – Yep, it still necessary to follow the steps, as it does setup environment for MXNET to run.
          2 – On my windows machine I’ve created conda enviornment, and site-packages is located at C:\Users\userName\AppData\Continuum\anaconda3\envs\envName\Lib\site-packages\…

  3. Hi PQXK8,

    I have a similar problem as TheJude. CPU version (py2 & py3, without
    cuDNN), try to run im2rec.py, and you will get:
    from _ctypes import Union, Structure, Array
    ImportError: cannot import name ‘Union’

    • Hi Crunchy,

      I would say try to use the new pip installation method for the mxnet. It worked very well the last time I’ve tried it on Windows.