Installing MxNet on Windows


#1

I was not able to find clear, good documentation for installing MxNet on Windows. Is MXNet “really” supported on Windows?

Can someone knowledgeable please provide clear instructions for installing the pre-built MxNet packages on Windows?

Here is my saga of trying to do this so far. Queries by others on the internet seems to suggest installing MXNet on Windows has been difficult for others as well. Clear instructions will help a lot.

  • Went to the Install tab of MXNet website. I first selected the “Windows”, “Python”, “CPU” combination. Wow, that gives a blank page! I consoled myself saying “OK, don’t bother about the CPU version for now; let me get the GPU version”.
  • So, I selected the “Windows”, “Python”, “GPU” combination. The resulting page is confusing. At the top it says “Follow the installation instructions in this guide to set up MXNet.” and near the bottom it says “Install MXNet with GPU support using CUDA 8.0” and then gives the command “pip install mxnet-cu80==1.0.0”.
  • I first tried the “pip install mxnet-cu80==1.0.0”. Ouch, pip says “Could not find a version that satisfies the requirement mxnet-cu80==1.0.0”. Seems like only older versions of MxNet are available via pip on Windows??
  • Alright, now that pip install didn’t work, I thought I shall try the other way, by following the “Follow the installation instructions in this guide to set up MXNet.”. So, I clicked on the link for “this guide” which took me to a page titled “Installing MxNet in Windows”.
  • One set of instructions there are for building the libraries yourself. Another more attractive option listed there is “Installing the Prebuilt Package on Windows”. So, I decided to go for the latter.
  • I followed the link given with “Download the latest prebuilt package from the Releases tab of MXNet.”. Clicking the “Releases” link there took me to the following page: https://github.com/apache/incubator-mxnet/releases.
  • Ouch! Bad luck again. The promised pre-built binaries can’t be found there! I could find only source code zip.
  • Alright, after spending some time Googling, I found that people stopped posting the pre-built packages for Windows at that location (without updating the link at the MXNet site?). Instead, the new place to find the pre-built binaries seems to be https://github.com/yajiedesign/mxnet/releases.
  • So, I go to that page. Sure enough, there are some 7z packages there. But, I could not find any instructions there about what to do with those packages!
  • After some Googling around again and reading random posts by people who have tried going through the pain before, I downloaded “prebuildbase_win10_x64_vc14_v2.7z” and “prebuildbase_win10_x64_vc14_v2.7z”. Wondered what should be done with them…
  • Anyway, created the folder called “C:\MxNet” as suggested in some of those (rather old) random posts and extracted the first package there.
  • Now, where exactly should the second package be extracted into? I guessed that the second package is probably intended to be extracted so that the “lib” and “include” folders created by the two packages are same. Was that really correct guess? Anyway, as per that wild guess, I placed the contents of those two packages so that the “lib” and “include” folders of the two align.
  • The “README.txt” file there says to download CUDNN. But, I also see that the cudnn dlls are included in the “prebuildbase_win10_x64_vc14_v2.7z”. So, is downloading CuDNN from NVidia site really necessary (i.e., README.txt not updated after beginning to include CUDNN dll)? Anyway, to be safe, I downloaded and installed CUDNN from NVidia site also.
  • Opened a command prompt from the folder C:\MXNet and ran “setupenv.cmd”.
  • Now, from the README file, I was supposed to run setup.py in c:/MXNet/python folder. So, I brought up Anaconda prompt, went to the folder c:\MXNet\python and ran “python setup.py install”. That ran fine.
  • After this, I go to Anaconda prompt and try “import mxnet”. But, that gives “module not found” error. What should I do for this?

Thank you.
P.S. I am using Anaconda distribution of Python.


#2

No replies so far :weary:

Are the active developers reading the messages on this group?

In contrast to the difficulties of installing MXNet on Windows, installing Theano on Windows needed just one line:

conda install theano

Though I haven’t done it yet, installing TensorFlow would be just one line as well since the package does show up on “conda search tensorflow”.

Wish installing MxNet was that simple!


#3

Please provide your review comments by using the steps in this PR: https://github.com/apache/incubator-mxnet/pull/8619


#4

Hi,

I have successfully built it on Windows 10, VS2015. I will try to contribute my method in a couple of days.

But you should know I used the free MKL library from Intel instead of OpenBLAS.


#5

Btw, I was talking about the C++ DLL :slight_smile:

For Python, try doing pip install mxnet-cu80 (if you have CUDA 8).


#6

Doing “pip install mxnet-cu80” did not work. I get the error saying “GPU is not enabled”. I had separately installed CuDnn from NVidia site as well.


#7

To build and install MXNet yourself, you need the following dependencies. Install the required dependencies:

  1. If Microsoft Visual Studio 2017 is not already installed, download and install it. You can download and install the free community edition. (https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15)

  2. Download and Install CMake GUI version if it is not already installed.

  3. Download and install OpenCV.

  4. Unzip the OpenCV package.

  5. Set the environment variable “OpenCV_DIR” to the value “OpenCV build directory”.

  6. If you don’t have the Intel Math Kernel Library (MKL) installed, download and install OpenBlas.

  7. Set the environment variable “OpenBLAS_HOME” to point to the “OpenBLAS” directory that contains the “include” and “lib” directories. Typically, you can find the directory in “C:\Program files (x86)\OpenBLAS”.

  8. Download and install CuDNN. To get access to the download link, register as an NVIDIA community user.

After you have installed all of the required dependencies, build the MXNet source code:

  1. Download the MXNet source code from GitHub.
  2. Open native tools command prompt for Visual Studio 2017( choose x64 or x86 native as required)
  3. Start CMake GUI tool installed previously, from within this command prompt
  4. In the CMake tool UI, “Browse Source” button and navigate to folder where MXNet source is downloaded. For example -"/GitHub/incubator-mxnet"
  5. Create a folder under “/GitHub/incubator-mxnet”, say releasex64
  6. Click “Browse Build…” and choose folder created above
  7. Click “Configure” button, a dialog prompt appears for choosing generator
  8. Choose appropriate generator, for example Visual Studio 2017 Win64, if building for x64
  9. Retain “use default native compilers” option
  10. Click Finish
  11. Click “Open Project” to open the generated project in Visual Studio IDE
  12. Choose “ALL_BUILD” and build the configuration that you want to build
  13. Find libmxnet.dll under the folder created in step 5 above for example “\GitHub\incubator-mxnet\releasex64\Debug\libmxnet.dll”

C++ api header files are not generated to one directory?
#8

There is a easy way to install mxnet directly without building it:
1.Install anaconda.

2.New folder, New file naming environment.yml.
Write it.

name: gluon
dependencies:
- python
- jupyter
- matplotlib
- pandas
- pip:
  - requests
  - mxnet>=0.11.1b20171003

3.Enter the folder using cmd window.

conda env create -f environment.yml
activate gluon

OK, you can use it.

If you want to use GPU,

pip uninstall mxnet
pip install --pre mxnet-cu75 # CUDA 7.5

or

pip uninstall mxnet
pip install --pre mxnet-cu80 # CUDA 8.0

Remver do it under (gluon) environment by the command “activate gluon”.
Rember to install CUDA before it.

This is a toturials about deep learning with MXNet ,which includes environment.yml file.


#9

Running “Configure” from CMake GUI tool (3.10.2) on OpenBLAS (0.2.20) says CMake support is experimental and only X86 support is currently available (alas I’m building for x64).