First, install all the necessary tools:
# 在 Mac 上:
$ sudo easy_install pip # 如果还没有安装 pip
$ sudo pip install --upgrade virtualenv
Next, create a new virtualenv environment. To create the environment in the ~/tensorflow directory, execute:
$ virtualenv --system-site-packages ~/tensorflow
$ cd ~/tensorflow
Then, activate virtualenv:
[colonelhou@localhost tensorflow]$ source bin/activate # 如果使用 bash
(tensorflow) [colonelhou@localhost tensorflow]$ # 终端提示符应该发生变化
Inside the virtualenv, install TensorFlow:
(tensorflow) [colonelhou@localhost tensorflow]$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
Train your first TensorFlow neural network model
(tensorflow) [colonelhou@localhost tensorflow]$ python ./lib/python2.7/site-packages/tensorflow/models/image/mnist/convolutional.py