Movies, and engineering.

Menu Close

Installing Apache MXNet Python library Windows 10

Hello, hello.

I wanted to share a quick how-to install MXNet on Windows 10 64-bit.

The solution here is a bit opinionated as I am using Anaconda to manage Python environments.

I will start from the beginning – Anaconda installation.

We will need Anaconda 4.3. You should use 64-bit Anaconda/Python 2.7 combination, as the environment we will create will be based on Python 2.7 64-bit in order to support MXNet. You can get anaconda here:

https://www.continuum.io/downloads

Follow the installation instructions and once it is done, lets go to the windows command line and type this:

having ‘anaconda’ argument in there will ensure we have common data analytics libraries, that are not necessary for MXNet, but nice to have. Also, we want to use Python 2.7 in this case, as MXNet has compatibility issues with Python 3.

Once the environment creation is complete, activate it by executing:

It is all for the terminal so far.

Lets get pre-combiled MXNet dlls!

You will need to download several packages from

https://github.com/yajiedesign/mxnet/releases

First, get the prebuild VC14 ( Visual Studio runtime 2015) package, it doesn’t contain any specific binaries, but it provides 3rd party libraries and helps to set all the environment variables that are necessary to run MXNet. In my case I got prebuildbase_win10_x64_vc14 

Once you download VC14 base archive, extract its contents somewhere. A good folder candidate would be ‘mxnet’ in the root of C: or any other drive. Let’s imagine that you have created ‘D:\mxnet’ folder.

Open terminal in that folder an run

It should finish quickly. You can verify that it was successful by going into the System -> Advanced System Settings and making sure it has MXNET_HOME:”D:\mxnet” environment variable setup.

Now, lets download GPU or CPU version of pre-compiled MXNet from the same page where you got the base package. At the moment of writing it is 20170702_mxnet_x64_vc14_gpu.7z

We won’t need the source code of mxnet, as we are not going to compile it from scratch, so you can IGNORE Source code (zip)

The archive will have contents that you need to extract to “D:\mxnet”, it might overwrite some of the folders, which is ok.

Optional STEP:

Now, if you used GPU version of MXNet, the last part would be is to get the cuDNN nVidia library for windows, you will have to register to get it, but essentially it is free.

cuDNN is available here:

https://developer.nvidia.com/rdp/cudnn-download

Once you download the archive, extract its contents to “D:\mxnet\3rdparty\cudnn”.

END OF Optional STEP.

It is time now to try to install python binding, so you can import mxnet inside a python project.

Go to the terminal where you had your MXNet Anaconda environment activated and jump to the location: “D:\mxnet\python”. Once you are in the correct location, run

If it ran without any errors, then we are ready to do our final test. Go back to the terminal where you acivated mxnet environment and first, start Python interpreter, and then run

You should be able to import the library.

Enjoy!

 

© 2017 Movies, and engineering. . All rights reserved.

Theme by Anders Norén.