I want to build an environment where I can experience deep learning, From various machine learning libraries, first install TensorFlow published by Google.
Mac OS X El Capitan 10.11.6 Python 2.7.12 pip 8.1.2
Install Python's package management tool Pip
Check if it is installed
$ pip -V
pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7)
Install if not installed
curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
Check Official Site and install according to your environment.
This time select the following
# Mac OS X, CPU only, Python 2.7:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl
Install with pip
$ pip install --upgrade $TF_BINARY_URL
By the way, I'm in a Proxy environment
$ set HTTP_PROXY=http://proxy.hoge.jp:port
$ set HTTPS_PROXY=http://proxy.hoge.jp:port
$ pip install --upgrade $TF_BINARY_URL --proxy=proxy.hoge.jp:port
Run the test code on the official site on the command line
$ python
...
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
>>>
Installation is complete if the test code works.
Recommended Posts