LoginSignup
2
3

More than 5 years have passed since last update.

TensFlowの環境設定メモ

Last updated at Posted at 2016-10-10

TensFlowの環境構築手順メモです

手順

  • python 3.5.2をインストール(参照したのは、こちら
brew update && brew upgrade
brew install pyenv
echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ~/.bash_profile
echo 'export PATH="${PYENV_ROOT}/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
exec $SHELL -l

pyenv install anaconda3-4.0.0
pyenv global anaconda3-4.0.0

pyenv global anaconda3-4.0.0
pyenv install -l
pyenv install 3.5.2
pyenv global 3.5.2  # 3.5.2を使う

これでpython3.5.2をinstall

  • TensFlowのinstall 参照するのはここ
$ conda create -n tensorflow python=3.5
$ conda install -c conda-forge tensorflow

install後の確認。コンソール起動後TensFlowのサンプルを動かしてみます。

$ 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

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3