3

I am trying to install the new MXNet from
validate-mxnet-installation.
I followed the instructions
(I chose options Linux->python->GPU->pip ) as you can see on the website and they were:

  1. install cuda8 from nvidia website
  2. install cuDNN 5 library
  3. update paths "PATH" and "LD_LIBRARY_PATH" in bashrc file
  4. install pip using these bunch of lines:

    $ sudo apt-get update
    $ sudo apt-get install -y wget python
    $ wget https://bootstrap.pypa.io/get-pip.py && sudo python get-pip.py    
    
  5. install the MXNet by: $ pip install mxnet-cu80
  6. validate the installation. I'm stuck here

To validate I was required to run the following:

  1. open terminal and type python to start python
  2. type the following:

    import mxnet as mx
    a = mx.nd.ones((2, 3), mx.gpu())
    b = a * 2 + 1
    b.asnumpy()
    array([[ 3.,  3.,  3.],
           [ 3.,  3.,  3.]], dtype=float32)  
    

I am getting the following error when I try to run the above:

 >>> import mxnet as mx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mxnet   

I'm kind of lost.. Does anyone know what should I do?

SiHa
  • 7,830
  • 13
  • 34
  • 43
Davis8988
  • 298
  • 4
  • 16
  • 1
    Which version of python are you using? 2 or 3? If you have both versions installed, which seems to be the case with all major distributions, you should make sure to install whatever package you need into your preferred python version...or both. – Sherlock70 May 23 '17 at 06:22
  • HI thanks guys. @iamkhush your advice helped. It didn't install successfully because it had no premission. So I tried the same line with sudo and it worked :) – Davis8988 May 23 '17 at 07:52

2 Answers2

2

I figured what the problem was:
mxnet wasn't installed correctldue to lack of premissions.

In step 5 need to type: sudo pip install mxnet-cu80 instead of just
"pip install mxnet-cu80 "

Thanks everyone

Davis8988
  • 298
  • 4
  • 16
0

Use common Linux repo installation applications like apt-get or yum to install pip3 (for Python 3) or pip (for Python 2). I use the former.

Use pip3 to install MXNet according to installation instruction.

You will also need some other packages which you can install through pip3.

It is best to create a specific Python environment and activate the environment before using pip3 inside it.

This way, you can have isolated installation in those environments.