ごく簡単なTensorFlowのインストール (MacとAnacondaで)

GPU使わないのがインストールは楽。 Anacondaをインストールしとく。

Python3.5の環境を作る。TensorFlowはPython3.5をサポートなので。

conda create -n tensorflow python=3.5 anaconda

TensorFlowをインストール(使うwhlはそのとき最新のを確認してね)。

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.2.1-py3-none-any.whl

あらもうできちゃった。

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))