installation of tensorflow on windows or MacOS

Windows:

I had the following error when installing tensorflow on windows 7 (Python 3.5.2 :: Anaconda 4.1.1 (64-bit))

Cannot remove entries from nonexistent file d:\anaconda32\envs\tst\lib\site-pack
ages\easy-install.pth

This is a anaconda environment problem. I found the solution here:

pip install --ignore-installed --upgrade pip setuptools
pip install --upgrade tensorflow

Now add the python from anaconda package permanently to cygwin.

echo 'export PATH=/cygdrive/c/anaconda3:$PATH' >> .bashrc

MacOS

Install TensorFlow in virtualenv to avoid version contamination.

mkvirtualenv cv -p python3
workon cv
pip3 install --upgrade tensorflow # for Python 3.n

Validate the installation

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

Run a test model

git clone https://github.com/tensorflow/models.git
cd ~/TensorFlow/models/tutorials/image/imagenet
python classify_image.py --image_file ~/TensorFlow/daisy.jpeg

TBD

Advertisements
installation of tensorflow on windows or MacOS

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s