这是第一百篇文章,mark一下咯。
tensorflow安装教程
http://blog.csdn.net/sydpz1987/article/details/51175359
傻瓜式安装教程如下:
安装虚拟环境,当时我已经安装过虚拟环境了,所以这一步就省略掉了。并没有测试这两条语句是否需要。
$ sudo easy_install pip
$ sudo pip install --upgrade virtualenv
接下来的语句我每一条都测试过
$ virtualenv --no-site-packages ~/tensorflow
$ source ~/tensorflow/bin/activate # If using bash
cpu only python2.7
(tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.0-py2-none-any.whl
安装tensor flow
(tensorflow)$ pip install --upgrade $TF_BINARY_URL
接下来就是使用了。
激活tensorflow
source ~/tensorflow/bin/activate
退出虚拟环境
(tensorflow)$ deactivate
可以用下边这些语句测试一下:
$ 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
>>>