Tensorflow 介紹
Tensorflow是Google發布的人工智能系統.
軟件可以從大量數據來判斷未來情況的趨勢.
英文官方網站:
http://tensorflow.org/
官方GitHub倉庫:
https://github.com/tensorflow/tensorflow
中文版 GitHub 倉庫:
https://github.com/jikexueyuanwiki/tensorflow-zh
Tensorflow 安裝
Tensorflow本身是基于python2/3平臺,所以可以直接通過pip進行安裝
- 建立虛擬環境virtualenv
$ virtualenv -p /usr/local/bin/python3.5 Env3.5
- 啟動虛擬環境
$ source Env3.5/bin/activate
- 導入安裝庫(oxs如果沒有安裝CUDA,只能通過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
- 測試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安裝成功