安裝 TensorFlow 2
TensorFlow 已在以下 64 位系統上進行測試並獲得支援
|
|
# Requires the latest pippip install --upgrade pip
# Current stable release for CPUpip install tensorflow
# Current stable release for GPU (Linux / WSL2)pip install tensorflow[and-cuda]
# Or try the preview build (unstable)pip install tf-nightly
下載軟體包
使用 Python 的 pip 軟體包管理器安裝 TensorFlow。
提供適用於 Ubuntu、Windows 和 macOS 的官方軟體包。
執行 TensorFlow 容器
TensorFlow Docker 映象已經過配置,可直接執行 TensorFlow。Docker 容器在虛擬環境中執行,是設定 GPU 支援最簡單的方法。
docker pull tensorflow/tensorflow:latest # Download latest stable image
docker run -it -p 8888:8888 tensorflow/tensorflow:latest-jupyter # Start Jupyter server
Google Colab:學習和使用 TensorFlow 的簡單方法
無需安裝——透過 Colaboratory 直接在瀏覽器中執行 TensorFlow 教程。Colaboratory 是一個 Google 研究專案,旨在幫助傳播機器學習教育和研究。它是一個 Jupyter 筆記本環境,無需任何配置,完全在雲端執行。閱讀部落格文章。