熱線電話:13121318867

登錄
首頁大數據時代如何快速安裝tensorFlow?需要注意哪些地方?
如何快速安裝tensorFlow?需要注意哪些地方?
2020-07-14
收藏

tensorFlow機器學習中應用最廣泛,最受歡迎的算法庫之一。Tensorflow由谷歌人工智能團隊谷歌大腦(Google Brain)開發和維護,Google幾乎在所有應用程序中都使用tensorFlow來實現機器學習。 下面小編整理了tensorFlow的安裝方法,幫助大家學習和使用。

一、安裝pip

在 Terminal 窗口中運行:

# Ubuntu/Linux 64-位 系統的執行代碼:

$ sudo apt-get install python-pip python-dev

# Mac OS X 系統的執行代碼:

$ sudo easy_install pip

$ sudo easy_install --upgrade six

二、

CPU 版

如果需要安裝 CPU 版本的 Tensorflow, 運行:

# python 2+ 的用戶:

$ pip install tensorflow

# python 3+ 的用戶:

$ pip3 install tensorflow

GPU 版

如果安裝 GPU 版的 Tensorflow, 需要找一個適合你版本的安裝文件, 并在 terminal 中執行:

# Ubuntu/Linux 64-bit, CPU only, Python 2.7

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0rc0-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7

# Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.0rc0-cp27-none-linux_x86_64.whl

# Mac OS X, CPU only, Python 2.7:

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0rc0-py2-none-any.whl

# Mac OS X, GPU enabled, Python 2.7:

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-0.12.0rc0-py2-none-any.whl

# Ubuntu/Linux 64-bit, CPU only, Python 3.4

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0rc0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4

# Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.0rc0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, CPU only, Python 3.5

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0rc0-cp35-cp35m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.5

# Requires CUDA toolkit 8.0 and CuDNN v5. For other versions, see "Installing from sources" below.

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-linux_x86_64.whl

# Mac OS X, CPU only, Python 3.4 or 3.5:

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0rc0-py3-none-any.whl

# Mac OS X, GPU enabled, Python 3.4 or 3.5:

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow_gpu-0.12.0rc0-py3-none-any.whl

最后, 根據自己的 python 版本, 在 terminal 中執行以下語句:

# 如果你是 Python 2. 請復制下面

$ sudo pip install --upgrade $TF_BINARY_URL

# 如果你是 Python 3. 請復制下面

$ sudo pip3 install --upgrade $TF_BINARY_URL

數據分析咨詢請掃描二維碼

若不方便掃碼,搜微信號:CDAshujufenxi

數據分析師資訊
更多

OK
客服在線
立即咨詢
日韩人妻系列无码专区视频,先锋高清无码,无码免费视欧非,国精产品一区一区三区无码
客服在線
立即咨詢