[PYTHON] Install Tensorflow on Mac

I want to build an environment where I can experience deep learning, From various machine learning libraries, first install TensorFlow published by Google.

Tensorflow official website

environment

Mac OS X El Capitan 10.11.6 Python 2.7.12 pip 8.1.2

Install Pip

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

Install TensorFlow

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

Operation check of Tensorflow

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

Install Tensorflow on Mac
Install TensorFlow on Ubuntu
Install pyenv on mac
Install Ansible on Mac
Install Python on Mac
Install Python 3 on Mac
Install Python 3.4 on Mac
Install Caffe on Mac
Install mecab on mac
Install mecab-python on Mac
Install pygame on python3.4 on mac
Install module on Anaconda (Mac)
Install OpenPose on mac (Catalina)
Install numba on your Mac
Install pandas 0.14 on python3.4 [on Mac]
Install Django on your Mac
Install pillow on Mac OSX 10.9
[Mac] Tips: Install pyquery on Mac [pyquery]
Install TensorFlow 1.15.0 on Raspberry Pi
Install CUDA10.1 + cuDNN7.6.5 + tensorflow-2.3.0 on Ubuntu 18.04
Install anaconda on Mac → Add Library
How to install mysql-connector-python on mac
Implement TensorFlow Lite on Mac [2019 Edition]
Steps to install matplotlib on Mac
Install Sphinx on Mac OS X
Install Python 3.7 Anaconda on MAC, but Python 2
Install Scipy on Mac OS Sierra
Install python3 on Mac (El Capitan)
How to install OpenCV on Mac
How to install TensorFlow on CentOS 7
Install mitmproxy on Mac OS X
Install VirtualBox on CentOS 7 on VirtualBox (mac + vagrant)
Steps to install python3 on mac
Install pgmagick on Mac OS X 10.9
python on mac
Install tensorflow. (Only!)
Install opencv on Mac using Anaconda Navigator
How to install drobertadams / toggl-cli on Mac
Install anaconda on a new Mac anyway
Error, warning when using TensorFlow on Mac
Install mecab on Marvericks
Install python on WSL
Install Faiss on CentOS 7
Install pip on Mavericks
Install Python on Pidora.
Install mongodb on termux
Install Scrapy on python3
Install docker on Fedora31
Pyenv + virtualenv on Mac
Install numba on CentOS 7.2
Install Plone (4.3.6) on MacOSX (10.10.3)
Install PySide2 on Ubuntu
Install Python3.4 on CentOS 6.6
numba installation on mac
Install gensim on Marvericks
Install JModelica on Ubuntu
Install Anaconda on Windows 10
Install numpy on Marvericks
Install python on windows
Install enebular-agent on Chromebook
Install pycuda on Windows10