1. 程式人生 > >mac,ubuntu下安裝tensorflow(anacanda)

mac,ubuntu下安裝tensorflow(anacanda)

安裝前,首先翻牆,谷歌的東西,你懂得。。。。

1.安裝anacanda

anacanda的好處就不用說了,集成了很多package,省得一一下載。

2.linux的ubuntu,和mac都是自帶python2.7。假如你需要python3版本的,下載anacanda3。進入目錄,執行sh檔案。 安裝好後,接下來mac和ubuntu操作一樣。檢視python版本 我直接輸入python是因為把python3的環境變數改了。直接指向python3了。 輸入conda

讓我們list下看看都有什麼包。輸入conda list

2.啟用tensorflow環境

輸入conda create -n tensorflow python=3.6

輸入source activate tensorflow  可以看到前面括號裡帶上了(tensorfolw)

3.安裝tensorflow

1.python2的各個版本

# Ubuntu/Linux 64-bit, CPU only, Python 2.7:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7. Requires CUDA toolkit 7.5 and CuDNN v4.
# For other versions, see "Install from sources" below.
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl

# Mac OS X, CPU only:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py2-none-any.whl

2.python3的各個版本

# Ubuntu/Linux 64-bit, CPU only, Python 3.4:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4. Requires CUDA toolkit 7.5 and CuDNN v4.
# For other versions, see "Install from sources" below.
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl

# Mac OS X, CPU only:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py3-none-any.whl