Create a gist now

Instantly share code, notes, and snippets.

Embed
Tensorflow installer (for Amazon Linux)
# install pyenv
sudo yum -y install gcc gcc-c++ make git openssl-devel bzip2-devel zlib-devel readline-devel sqlite-devel bzip2 sqlite
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
# install pip
sudo easy_install pip
# configure pyenv local 3.6.0 in tensowflow directory
cd ~
mkdir tensorflow
cd tensorflow
pyenv install 3.6.0
pyenv local 3.6.0
# install tensorflow.
# list of packages are here: https://www.tensorflow.org/install/install_linux#the_url_of_the_tensorflow_python_package
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp36-cp36m-linux_x86_64.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL
# testing tensorflow
python -c "import os; \
import tensorflow as tf; \
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'; \
c = tf.constant('Tensorflow works!'); \
sess = tf.Session(); \
print(sess.run(c))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment