Skip to content

Instantly share code, notes, and snippets.

@jeongho
Last active September 26, 2017 05:21
Show Gist options
  • Save jeongho/633a11f0ba68b115a110cd2ac92896c3 to your computer and use it in GitHub Desktop.
Save jeongho/633a11f0ba68b115a110cd2ac92896c3 to your computer and use it in GitHub Desktop.
Installing TensorFlow on Mac OS X
#!/usr/bin/env bash
# install with anacona
# https://www.tensorflow.org/install/install_mac#installing_with_anaconda
conda create -n tensorflow
source activate tensorflow
#Python 2.7
TF_PYTHON_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.3.0-py2-none-any.whl
#Python 3.4, 3.5, or 3.6
#TF_PYTHON_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.3.0-py3-none-any.whl
pip install --ignore-installed --upgrade ${TF_PYTHON_URL}
source deactivate
# validate installation
cat <<EOF > hello.py
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
EOF
source activate tensorflow
time python hello.py
source deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment