Tensorflow 介紹
Tensorflow是Google發(fā)布的人工智能系統(tǒng).
軟件可以從大量數(shù)據(jù)來(lái)判斷未來(lái)情況的趨勢(shì).
英文官方網(wǎng)站:
http://tensorflow.org/
官方GitHub倉(cāng)庫(kù):
https://github.com/tensorflow/tensorflow
中文版 GitHub 倉(cāng)庫(kù):
https://github.com/jikexueyuanwiki/tensorflow-zh
Tensorflow 安裝
Tensorflow本身是基于python2/3平臺(tái),所以可以直接通過(guò)pip進(jìn)行安裝
- 建立虛擬環(huán)境virtualenv
$ virtualenv -p /usr/local/bin/python3.5 Env3.5
- 啟動(dòng)虛擬環(huán)境
$ source Env3.5/bin/activate
- 導(dǎo)入安裝庫(kù)(oxs如果沒(méi)有安裝CUDA,只能通過(guò)CPU安裝)
# Mac OS X, CPU only, Python 3.4 or 3.5:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0rc1-py3-none-any.whl
- 安裝tensorflow
# Python 3
$ pip3 install --upgrade $TF_BINARY_URL
- 測(cè)試Tensorflow
$ 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
至此 Tensorflow安裝成功