- 參考Github Tensorflow Setup
- sudo apt-get install python-pip python-dev
- sudo pip install –upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
- 測試運行(注意,不要在git clone 後在Tensorflow的目錄裏進行如下實驗,參考Error running basic tensorflow example)
- python
- import tensorflow as tf
- hello = tf.constant(“Hello, TensorFlow!”)
- sess = tf.Session()
- print sess.run(hello)
- a = tf.constant(10)
- b = tfconstant(32)
- print sess.run(a+b)
- 安裝jupyter
- sudo pip3 install jupyter,也可以使用pip2,取決與/local/usr/bin中pip的版本
- sudo apt-get install build-essential python3-dev
- 運行jupyter notebook
- 參考https://jupyter.readthedocs.io/en/latest/install.html
- 安裝tdb
- 用ipython運行下面腳本
import notebook.nbextensions
import urllib
import zipfile
SOURCE_URL = 'https://github.com/ericjang/tdb/releases/download/tdb_ext_v0.1/tdb_ext.zip'
urllib.urlretrieve(SOURCE_URL, 'tdb_ext.zip')
with zipfile.ZipFile('tdb_ext.zip', "r") as z:
z.extractall("")
notebook.nbextensions.install_nbextension('tdb_ext',user=True)
由於使用了python3,可能出現如下錯誤:AttributeError: ‘module’ object has no attribute ‘urlretrieve’,則將urllib.urlretrieve(SOURCE_URL, ‘tdb_ext.zip’)改爲urllib.request.urlretrieve(SOURCE_URL, ‘tdb_ext.zip’) - sudo pip install tfdebugger
- sudo apt-get install python-matplotlib
- git clone https://github.com/ericjang/tdb
- 打開jupyter notebook即可運行
- 參考:https://github.com/ericjang/tdb
- 用ipython運行下面腳本
Tensorflow 安裝
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.