Deep Learning, Python

TensorFlow 01: multiple versions of numpy

Started to write another paper, also I am reading the DL Textbook, but still have time to try new things….the TensorFlow. Everything is in the website, but you are not along cuz errors are always be with you 😀

– check python version (2.7 or 3.3+)
– install pip:

# Ubuntu/Linux 64-bit
$ sudo apt-get install python-pip python-dev
# Mac OS X $
sudo easy_install pip


– install TensorFlow:

(Linux is okay with GPU, Mac not.)

# Ubuntu/Linux 64-bit, CPU only:
$ sudo pip install --upgrade

# Ubuntu/Linux 64-bit, GPU enabled:
$ sudo pip install --upgrade

# Mac OS X, CPU only:
$ sudo easy_install --upgrade six
$ sudo pip install --upgrade


Test TensorFlow:
Run python in the terminal, but the error is:

Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
RuntimeError: module compiled against API version a but this version of numpy is 6

I get another warning:

You are using pip version 7.1.2, however version 8.0.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Then please do the following:

sudo pip install —upgrade pip

“sudo” should be added.

But it seems fine. The main reason is the multiple versions of numpy.
Please note, for my Mac, there are two versions of numpy,1.6 and 1.10.(It could happen in your machine! ) I installed 1.10 by using pip command, but when I checked the version, it used another one.
Use the following to check your version:

>>> import numpy
>>> print numpy.__version__

Or, simply by typing:

python -c "import numpy; print numpy.version.version”

You need to know the path of numpy, then remove it manually:

 mac$ python -c 'import os,numpy;print(numpy.__file__)'
 mac$ sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy

Then install new numpy again, have a try and it should work!


More: I tried caffe few month ago, and it was really killing me…the installation was complex and I met a list of errors. I also want to play with Torch. But after their ads from NIPS, I was excited about the distribution part. Hopefully, I can grasp it easily. Great company create tools…that’s it. News come out that Baidu also released a new AI software WARP-CTC, which is involved with RNNs, contributing to DL community. For sure we are “rolling” in a great era.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s