Handling various errors when installing Tensorflow

The problem happens if protobuf for python is older then 3.1.0 and TF is older too. I had exact problem as below:

$ python

Python 2.7.10 (default, Jul 30 2016, 19:40:32)
>>> from tensorflow.tools.tfprof import tfprof_log_pb2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tfprof

This is how i solved it:

Updated setuptools to latest 32.x or above version (I did this because my TF install was failing to update setuptools to version 32.x):

pip install update --user setuptools

After that I installed TF as below:

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl
$ sudo pip install --upgrade $TF_BINARY_URL

You will note that TF 12.1 installs the following:

Collecting tensorflow==0.12.1 from https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl
Collecting numpy>=1.11.0 (from tensorflow==0.12.1)
Collecting protobuf>=3.1.0 (from tensorflow==0.12.1)
Collecting setuptools (from protobuf>=3.1.0->tensorflow==0.12.1)

After successful TF Install:

Successfully installed protobuf-3.1.0.post1 tensorflow-0.12.1

I tried the very first command as below:

$ python

Python 2.7.10 (default, Jul 30 2016, 19:40:32)
>>> from tensorflow.tools.tfprof import tfprof_log_pb2
>>> tfprof_log_pb2
<module 'tensorflow.tools.tfprof.tfprof_log_pb2' from '/Library/Python/2.7/site-packages/tensorflow/tools/tfprof/tfprof_log_pb2.pyc'>

 

Advertisements

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