├── Installing from sources.md ├── README.md ├── SUMMARY.md ├── Test-TensorFlow-installation.md ├── a_tool_developers_guide_to_tensorflow_model_files.md ├── adding_a_new_op.md ├── api.md ├── basic_usage.md ├── c++_api.md ├── chapter1.md ├── common-probliems.md ├── convolutional_neural_networks.md ├── custom_data_readers.md ├── deep_dream_visual_hallucinations.md ├── deep_mnist_for_experts.md ├── distributed_tensorflow.md ├── download_and_setup.md ├── how-tos.md ├── how_tensorflow_mechanics_101.md ├── how_to_export_and_import_a_model.md ├── how_to_quantize_neural_networks_with_tensorflow.md ├── how_to_retrain_inception_using_transfer_learning.md ├── how_to_write_tensorflow_code.md ├── howto.md ├── image_recognition.md ├── introduction.md ├── mandelbrot_set.md ├── mnist_data_download.md ├── mnist_for_ml_beginners.md ├── partial_differential_equations.md ├── preface.md ├── python_api.md ├── reading_data.md ├── recurrent_neural_networks.md ├── resources.md ├── sequence-to-sequence_models.md ├── sharing_variables.md ├── syntaxnet_neural_models_of_syntax.md ├── tensorboard_graph_visualization.md ├── tensorboard_visualizing_learning.md ├── tensorflow_mechanics_101.md ├── tensorflow_serving.md ├── testinstallation.md ├── threading_and_queues.md ├── tutor.md ├── using_gpus.md ├── variables_creation,_initializing,_saving,_and_rest.md ├── vector_representations_of_words.md └── writing_documentation.md /Installing from sources.md: -------------------------------------------------------------------------------- 1 | # 由原始碼安裝 2 | 3 | 利用pip從原始碼安裝你需要建立pip wheel,請參考前述pip安裝章節來安裝pip。 4 | 5 | 從Clone TensorFlow的repository: 6 | 7 | ``` 8 | $ git clone https://github.com/tensorflow/tensorflow 9 | 10 | ``` 11 | 12 | 注意這些指令會安裝最新版本的TensorFlow master branch。若你想安裝某個特定的branch(例如某個release branch),在`git clone`指令加上`-b `與`--recurse-submodules`來抓取r0.8或更早的TensorFlow protobuf library。 13 | 14 | ## Linux的安裝 15 | 16 | ### 安裝Bazel 17 | 18 | 參考[這裡](http://bazel.io/docs/install.html)的指示來安裝bazel。接著由[installer for your system](https://github.com/bazelbuild/bazel/releases)下載最新的穩定版bazel版本並由以下運行安裝: 19 | 20 | ``` 21 | $ chmod +x PATH_TO_INSTALL.SH 22 | $ ./PATH_TO_INSTALL.SH --user 23 | 24 | ``` 25 | 記得將`PATH_TO_INSTALL.SH`換成你下載installer的位置。 26 | 27 | 最後根據指示將**bazel**放進你的binary path。 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # 這可能是Google對未來影響最深遠的OpenSource! 4 | 5 | ### Hi, 我是一名資工系的台灣學生 6 | ### 當你想開始一項開源,有沒有這樣的想法曾經出現: 7 | ### 既然要看懂官方文件,何不順便翻成中文造福更多人? 8 | 9 | 10 | --- 11 | 12 | 13 | # [TensorFlow](https://www.tensorflow.org/)官方文件的繁體中文在地化計畫 14 | ### 認識Google繼Android後最有可能改變世界的開源[TensorFlow](https://www.tensorflow.org/) 15 | [觀看TensorFlow簡介](https://www.youtube.com/watch?v=oZikw5k_2FM) 16 | * 不知如何開始[TensorFlow](https://www.tensorflow.org/)? 17 | * 官方文件英文看得好痛苦? 18 | * 你知道已經有zh-CH版本嗎? 為什麼沒有zh-TW? 19 | 20 | ###邀請您參與[TensorFlow](https://www.tensorflow.org/)官方文件的繁體中文在地化(zh-TW Localization) 21 | #### 你可以: 22 | * 協助我們翻譯,並一次看懂TensorFlow ! 23 | * 幫助台灣更快掌握世界一流的機器學習服務 ! 24 | 25 | #如何開始 26 | 27 | * Gitbook: [tensorflow-documentation-zh-tw](https://www.gitbook.com/book/cbbjames/tensorflow-documentation-zh-tw/details) 28 | * Github: [tensorflow-documentation-zh-tw](https://github.com/cbbjames/tensorflow_docs_zh-TW) 29 | * 30 | * 逛一逛吧! [TensorFlow](https://www.tensorflow.org/) (TensorFlow版本: r0.10) 31 | * 加入FB社群 [TensorFlow Taiwan](https://www.facebook.com/groups/294714030866185/)討論 32 | * 使用Gitbook [教學](https://kingofamani.gitbooks.io/git-teach/content/chapter_6_gitbook/chapter_6_gitbookgitbook2.html) 33 | * 熟悉 [Markdown](http://markdown.tw/#list) 語法 34 | * 友站zh-CH的翻譯經驗 [TensorFlow 官方文档中文版](http://wiki.jikexueyuan.com/project/tensorflow-zh/) 35 | 36 | 37 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [Preface](README.md) 4 | * [GET STARTED](chapter1.md) 5 | * [簡介](introduction.md) 6 | * [下載與安裝](download_and_setup.md) 7 | * [測試安裝](testinstallation.md) 8 | * [由原始碼安裝](Installing from sources.md) 9 | * [常見問題](common-probliems.md) 10 | * [基本操作](basic_usage.md) 11 | * [Tutorials](preface.md) 12 | * [tutor](tutor.md) 13 | * [MNIST For ML Beginners](mnist_for_ml_beginners.md) 14 | * [Deep MNIST for Experts](deep_mnist_for_experts.md) 15 | * [TensorFlow Mechanics 101](tensorflow_mechanics_101.md) 16 | * [TensorFlow Serving](tensorflow_serving.md) 17 | * [Convolutional Neural Networks](convolutional_neural_networks.md) 18 | * [Vector Representations of Words](vector_representations_of_words.md) 19 | * [Recurrent Neural Networks](recurrent_neural_networks.md) 20 | * [Sequence-to-Sequence Models](sequence-to-sequence_models.md) 21 | * [SyntaxNet: Neural Models of Syntax](syntaxnet_neural_models_of_syntax.md) 22 | * [Mandelbrot Set](mandelbrot_set.md) 23 | * [Partial Differential Equations](partial_differential_equations.md) 24 | * [MNIST Data Download](mnist_data_download.md) 25 | * [Image Recognition](image_recognition.md) 26 | * [Deep Dream Visual Hallucinations](deep_dream_visual_hallucinations.md) 27 | * [How-Tos](how-tos.md) 28 | * [how_to](howto.md) 29 | * [Variables: Creation, Initializing, Saving, and Restoring](variables_creation,_initializing,_saving,_and_rest.md) 30 | * [TensorFlow Mechanics 101](how_tensorflow_mechanics_101.md) 31 | * [TensorBoard: Visualizing Learning](tensorboard_visualizing_learning.md) 32 | * [TensorBoard: Graph Visualization](tensorboard_graph_visualization.md) 33 | * [Reading Data](reading_data.md) 34 | * [Distributed TensorFlow](distributed_tensorflow.md) 35 | * [Threading and Queues](threading_and_queues.md) 36 | * [Adding a New Op](adding_a_new_op.md) 37 | * [How to write TensorFlow code](how_to_write_tensorflow_code.md) 38 | * [Writing Documentation](writing_documentation.md) 39 | * [Custom Data Readers](custom_data_readers.md) 40 | * [Using GPUs](using_gpus.md) 41 | * [Sharing Variables](sharing_variables.md) 42 | * [A Tool Developer's Guide to TensorFlow Model Files](a_tool_developers_guide_to_tensorflow_model_files.md) 43 | * [How to Retrain Inception using Transfer Learning](how_to_retrain_inception_using_transfer_learning.md) 44 | * [How to Export and Import a Model](how_to_export_and_import_a_model.md) 45 | * [How to Quantize Neural Networks with TensorFlow](how_to_quantize_neural_networks_with_tensorflow.md) 46 | * [API](api.md) 47 | * [Python API](python_api.md) 48 | * [C++ API](c++_api.md) 49 | * [Resources](resources.md) 50 | 51 | -------------------------------------------------------------------------------- /Test-TensorFlow-installation.md: -------------------------------------------------------------------------------- 1 | # 測試安裝 2 | 3 | -------------------------------------------------------------------------------- /a_tool_developers_guide_to_tensorflow_model_files.md: -------------------------------------------------------------------------------- 1 | # 給開發者的TensorFlow模型檔案指南 2 | 3 | -------------------------------------------------------------------------------- /adding_a_new_op.md: -------------------------------------------------------------------------------- 1 | # 如何新增Op 2 | 3 | -------------------------------------------------------------------------------- /api.md: -------------------------------------------------------------------------------- 1 | # API 2 | 3 | -------------------------------------------------------------------------------- /basic_usage.md: -------------------------------------------------------------------------------- 1 | # 基本操作 2 | 3 | -------------------------------------------------------------------------------- /c++_api.md: -------------------------------------------------------------------------------- 1 | # C++ API 2 | 3 | -------------------------------------------------------------------------------- /chapter1.md: -------------------------------------------------------------------------------- 1 | # 開始 2 | 3 | 4 | --- 5 | 6 | 7 | ## [簡介](introduction.md) 8 | ## [下載與安裝](download_and_setup.md) 9 | ## [基本操作](basic_usage.md) -------------------------------------------------------------------------------- /common-probliems.md: -------------------------------------------------------------------------------- 1 | # 常見問題 2 | 3 | -------------------------------------------------------------------------------- /convolutional_neural_networks.md: -------------------------------------------------------------------------------- 1 | # 卷積神經網路(Convolutional Neural Networks) 2 | 3 | -------------------------------------------------------------------------------- /custom_data_readers.md: -------------------------------------------------------------------------------- 1 | # 自訂資料讀取 2 | 3 | -------------------------------------------------------------------------------- /deep_dream_visual_hallucinations.md: -------------------------------------------------------------------------------- 1 | # Deep Dream 幻視(Visual Hallucinations)軟體 2 | 3 | -------------------------------------------------------------------------------- /deep_mnist_for_experts.md: -------------------------------------------------------------------------------- 1 | # 給機器學習專家——深入MNIST 2 | 3 | -------------------------------------------------------------------------------- /distributed_tensorflow.md: -------------------------------------------------------------------------------- 1 | # TensorFlow的分散式運算 2 | 3 | -------------------------------------------------------------------------------- /download_and_setup.md: -------------------------------------------------------------------------------- 1 | # 下載與安裝 2 | 3 | [英文原文](https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#download-and-setup) 4 | 5 | 你可以從我們提供的安裝包或是直接由Github下載來安裝TensorFlow 6 | 7 | ## 系統需求 8 | TensorFlow Python API 支援 Python 2.7 and Python 3.3+ 9 | 10 | GPU (僅限Linux) 搭載Cuda Toolkit 7.5 及 cuDNN v4 最佳。其他版本(Cuda toolkit >= 7.0 and cuDNN 6.5(v2), 7.0(v3), v5)僅限直接由原始碼安裝。細節請參照[Cuda installation](https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#optional-install-cuda-gpus-on-linux)。 11 | 12 | ##總攬 13 | 14 | 我們支援以下方式來安裝TensorFlow: 15 | 16 | * [Pip install](https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#pip-installation): 在本機安裝TensorFlow,可能會升級某些Python的Package,影響您電腦裡目前的Python程式。 17 | * [Virtualenv install](https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#virtualenv-installation): 僅安裝在自目錄下,不會影響您電腦裡任何的其他Python程式。 18 | * [Anaconda install](https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#anaconda-installation): 在 Anaconda Python 環境下安裝,不會影響您電腦裡任何的其他Python程式。 19 | * [Docker install](https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#docker-installation): 安裝在Docker的容器下,獨立於您電腦的任何程式。 20 | * [Installing from sources](https://www.tensorflow.org/versions/r0.10/get_started/os_setup.html#installing-from-sources): 建立pip wheel並用pip安裝TensorFlow。 21 | 22 | 若您熟悉Pip, Virtualenv, Anaconda, 或 Docker,您可以針對你的需求來安裝。 23 | pip 與 Docker 的映象檔名在上述對應的連結中。 24 | 若有安裝困難,請見[常見問題](https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#common-problems)。 25 | 26 | ## Pip安裝 27 | 28 | Pip是一個package管理系統,可用來管理與安裝以Python寫的軟體package。 29 | 30 | Pip安裝過程可能會安裝或升級的package清單: [REQUIRED_PACKAGES section of setup.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/setup.py) 31 | 32 | 安裝 pip (or pip3 for python3) : 33 | 34 | ``` 35 | # Ubuntu/Linux 64-bit 36 | $ sudo apt-get install python-pip python-dev 37 | 38 | # Mac OS X 39 | $ sudo easy_install pip 40 | $ sudo easy_install --upgrade six 41 | 42 | ``` 43 | 44 | 接著選擇正確的二進位檔安裝: 45 | 46 | ``` 47 | # Ubuntu/Linux 64-bit, CPU only, Python 2.7 48 | $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl 49 | 50 | # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 51 | # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. 52 | $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl 53 | 54 | # Mac OS X, CPU only, Python 2.7: 55 | $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl 56 | 57 | # Ubuntu/Linux 64-bit, CPU only, Python 3.4 58 | $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl 59 | 60 | # Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 61 | # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. 62 | $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl 63 | 64 | # Ubuntu/Linux 64-bit, CPU only, Python 3.5 65 | $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl 66 | 67 | # Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 68 | # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. 69 | $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl 70 | 71 | # Mac OS X, CPU only, Python 3.4 or 3.5: 72 | $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl 73 | 74 | ``` 75 | 76 | 安裝TensorFlow: 77 | 78 | ``` 79 | # Python 2 80 | $ sudo pip install --upgrade $TF_BINARY_URL 81 | 82 | # Python 3 83 | $ sudo pip3 install --upgrade $TF_BINARY_URL 84 | 85 | ``` 86 | **注意**: 如果你想從<0.7.1的版本升級,先解安裝舊版本的TensorFlow並用`pip uninstall` 確保你之後可以完整地安裝。 87 | 88 | 現在你可以 [測試你的安裝](testinstallation.md) 89 | 90 | ## Virtualenv 安裝 91 | 92 | [Virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/)是一個可以保持位於不同位置的Python專案的依存性(dependencies)的工具。 利用Virtualenv安裝TensorFlow並不會覆蓋本來存在Python packages版本。 93 | 94 | [Virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/)的安裝流程 95 | * 安裝pip 及 Virtualenv 96 | * 建立Virtualenv環境 97 | * 啟用Virtualenv環境並在環境中安裝TensorFlow 98 | * 當你每次想使用TensorFlow,先啟動Virtualenv環境 99 | 100 | 安裝pip 及 Virtualenv: 101 | 102 | ``` 103 | # Ubuntu/Linux 64-bit 104 | $ sudo apt-get install python-pip python-dev python-virtualenv 105 | 106 | # Mac OS X 107 | $ sudo easy_install pip 108 | $ sudo pip install --upgrade virtualenv 109 | 110 | ``` 111 | 於目錄` ~/tensorflow`下建立Virtualenv環境: 112 | 113 | ``` 114 | $ virtualenv --system-site-packages ~/tensorflow 115 | 116 | ``` 117 | 啟用Virtualenv環境並在環境中安裝TensorFlow 118 | 119 | ``` 120 | $ source ~/tensorflow/bin/activate # If using bash 121 | $ source ~/tensorflow/bin/activate.csh # If using csh 122 | (tensorflow)$ # Your prompt should change 123 | 124 | ``` 125 | 126 | 同樣的,如同Pip安裝的步驟選擇正確的二進位檔安裝: 127 | 128 | ``` 129 | 130 | # Ubuntu/Linux 64-bit, CPU only, Python 2.7 131 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl 132 | 133 | # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 134 | # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. 135 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl 136 | 137 | # Mac OS X, CPU only, Python 2.7: 138 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl 139 | 140 | # Ubuntu/Linux 64-bit, CPU only, Python 3.4 141 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl 142 | 143 | # Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 144 | # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. 145 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl 146 | 147 | # Ubuntu/Linux 64-bit, CPU only, Python 3.5 148 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl 149 | 150 | # Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 151 | # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. 152 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl 153 | 154 | # Mac OS X, CPU only, Python 3.4 or 3.5: 155 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl 156 | 157 | ``` 158 | 159 | 最後安裝TensorFlow: 160 | 161 | ``` 162 | 163 | # Python 2 164 | (tensorflow)$ pip install --upgrade $TF_BINARY_URL 165 | 166 | # Python 3 167 | (tensorflow)$ pip3 install --upgrade $TF_BINARY_URL 168 | 169 | ``` 170 | 171 | Virtualenv環境啟動後,現在你可以 [測試安裝](testinstallation.md) 172 | 173 | 當你使用完畢,關閉環境: 174 | 175 | ``` 176 | (tensorflow)$ deactivate 177 | 178 | $ # Your prompt should change back 179 | 180 | ``` 181 | 182 | 若要稍後繼續使用TensorFlow,你需要再次啟動Virtualenv環境: 183 | 184 | ``` 185 | $ source ~/tensorflow/bin/activate # If using bash. 186 | $ source ~/tensorflow/bin/activate.csh # If using csh. 187 | (tensorflow)$ # Your prompt should change. 188 | # Run Python programs that use TensorFlow. 189 | ... 190 | # When you are done using TensorFlow, deactivate the environment. 191 | (tensorflow)$ deactivate 192 | 193 | ``` 194 | 195 | ##Anaconda環境安裝 196 | Anaconda是一個囊括許多科學數值計算package的Python版本。Anaconda使用了一個名為「conda」的package管理系統,類似Virtualenv,Anaconda也擁有自己的環境管理系統([environment system](http://conda.pydata.org/docs/using/envs.html))。 197 | 198 | Virtualenv下的conda環境可以針對不同Python專案提供各自的版本需求。在Anaconda環境下安裝TensorFlow不會覆蓋TensorFlow需要使用到的Python package版本。 199 | 200 | * 安裝Anaconda。 201 | * 創建一個conda環境 202 | * 啟動conda環境並在環境中安裝TensorFlow 203 | * 安裝後,每次你想使用TensorFlow時都需要先啟動這個conda環境 204 | 205 | 安裝Anaconda 206 | 207 | 請依照[Anaconda download site](https://www.continuum.io/downloads)的指示 208 | 209 | 創建一個名為**TensorFlow**的conda環境: 210 | 211 | ``` 212 | # Python 2.7 213 | $ conda create -n tensorflow python=2.7 214 | 215 | # Python 3.4 216 | $ conda create -n tensorflow python=3.4 217 | 218 | # Python 3.5 219 | $ conda create -n tensorflow python=3.5 220 | 221 | ``` 222 | 223 | 啟動這個環境並用pip安裝TensorFlow,利用`--ignore-installed`參數避免`easy_install`錯誤。 224 | 225 | ``` 226 | $ source activate tensorflow 227 | (tensorflow)$ # Your prompt should change 228 | 229 | ``` 230 | 231 | 同樣的,如同Pip安裝的步驟選擇正確的二進位檔安裝: 232 | 233 | ``` 234 | 235 | # Ubuntu/Linux 64-bit, CPU only, Python 2.7 236 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl 237 | 238 | # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 239 | # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. 240 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl 241 | 242 | # Mac OS X, CPU only, Python 2.7: 243 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl 244 | 245 | # Ubuntu/Linux 64-bit, CPU only, Python 3.4 246 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl 247 | 248 | # Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 249 | # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. 250 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl 251 | 252 | # Ubuntu/Linux 64-bit, CPU only, Python 3.5 253 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl 254 | 255 | # Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 256 | # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below. 257 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl 258 | 259 | # Mac OS X, CPU only, Python 3.4 or 3.5: 260 | (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl 261 | 262 | ``` 263 | 264 | 最後安裝TensorFlow: 265 | 266 | ``` 267 | 268 | # Python 2 269 | (tensorflow)$ pip install --upgrade $TF_BINARY_URL 270 | 271 | # Python 3 272 | (tensorflow)$ pip3 install --upgrade $TF_BINARY_URL 273 | 274 | ``` 275 | 276 | conda環境啟動後,你可以 [測試安裝](testinstallation.md) 277 | 278 | 當你使用完畢,關閉環境: 279 | 280 | ``` 281 | (tensorflow)$ source deactivate 282 | 283 | $ # Your prompt should change back 284 | 285 | ``` 286 | 287 | 若要再次使用TensorFlow時,重新啟動conda環境: 288 | 289 | ``` 290 | $ source activate tensorflow 291 | (tensorflow)$ # Your prompt should change. 292 | # Run Python programs that use TensorFlow. 293 | ... 294 | # When you are done using TensorFlow, deactivate the environment. 295 | (tensorflow)$ source deactivate 296 | 297 | ``` 298 | 299 | ## Docker安裝 300 | 301 | [Docker](http://docker.com/)是一個在你的電腦建立SCS(Self-Contained Systems) Linux OS的系統。當你透過Docker安裝並運行TensorFlow,他完全獨立於你電腦裡安裝的所有package。 302 | 303 | 我們提供四個Docker映像: 304 | 305 | * **gcr.io/tensorflow/tensorflow**: TensorFlow CPU binary image 306 | * **gcr.io/tensorflow/tensorflow:latest-devel**: CPU Binary image plus source code 307 | * **gcr.io/tensorflow/tensorflow:latest-gpu**: TensorFlow GPU binary image 308 | * **gcr.io/tensorflow/tensorflow:latest-devel-gpu**: GPU Binary image plus source code 309 | 310 | 對於最新版本(e.g., 0.9.0-gpu).我們加上了*latset* tag 311 | 312 | Docker安裝的流程如下: 313 | * 在你的電腦安裝Docker 314 | * 創建一個[Docker group](http://docs.docker.com/engine/installation/ubuntulinux/#create-a-docker-group),之後不需要`suod就能啟動` 315 | * 啟動包含TensorFlow映像的Docker容器,第一次啟動時映像會自動下載 316 | 317 | 關於安裝Docker請參考[installing Docker](http://docs.docker.com/engine/installation/) 318 | 319 | 安裝好Docker之後,啟動Docker容器及TensorFlow的二進位檔映像: 320 | ``` 321 | $ docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow 322 | ``` 323 | 324 | `-p 8888:8888`的參數是用於傳回Docker容器的內部port給host,確保Jupyter notebook連接。 325 | 326 | port的格式是 **hostPort:containerPort**。你可以用任何有效的port number作為host port但container Port的部分必須是`8888`。 327 | 328 | NVidia GPU支援最新的NVidia驅動安裝與[nvidia-docker](https://github.com/NVIDIA/nvidia-docker): 329 | ``` 330 | $ nvidia-docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow:latest-gpu 331 | 332 | ``` 333 | 334 | 更多細節可見[TensorFlow docker readme](https://www.google.com/url?q=https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tools/docker&usg=AFQjCNFvS7IAkd_CPrZ3DK7tpMmBKmRrXg) 335 | 336 | 你現在可以利用Docker容器[測試安裝](testinstallation.md)。 -------------------------------------------------------------------------------- /how-tos.md: -------------------------------------------------------------------------------- 1 | # 使用指南 2 | 3 | -------------------------------------------------------------------------------- /how_tensorflow_mechanics_101.md: -------------------------------------------------------------------------------- 1 | # TensorFlow操作指南 2 | 3 | -------------------------------------------------------------------------------- /how_to_export_and_import_a_model.md: -------------------------------------------------------------------------------- 1 | # 模型的輸入輸出 2 | 3 | -------------------------------------------------------------------------------- /how_to_quantize_neural_networks_with_tensorflow.md: -------------------------------------------------------------------------------- 1 | # 如何以TensorFlow量化神經網路 2 | 3 | -------------------------------------------------------------------------------- /how_to_retrain_inception_using_transfer_learning.md: -------------------------------------------------------------------------------- 1 | # 如何利用學習轉移(Transfer Learning)重新訓練Inception 2 | 3 | -------------------------------------------------------------------------------- /how_to_write_tensorflow_code.md: -------------------------------------------------------------------------------- 1 | # TensorFlow上的原始碼風格 2 | 3 | -------------------------------------------------------------------------------- /howto.md: -------------------------------------------------------------------------------- 1 | # how_to 2 | 3 | -------------------------------------------------------------------------------- /image_recognition.md: -------------------------------------------------------------------------------- 1 | # 影像辨識 2 | 3 | -------------------------------------------------------------------------------- /introduction.md: -------------------------------------------------------------------------------- 1 | # 簡介 2 | [英文原文](https://www.tensorflow.org/versions/r0.8/get_started/index.html) 3 | 4 | 本節我們將會讓你了解並運行TensorFlow! 5 | 6 | 在我們真正開始前,讓我們看一段TensorFlow Python API的程式碼,好讓你對我們即將開始的內容有點概念。 7 | 8 | 這是一個簡單的Python程式,它造出一些二維的資料並用直線去配適(fit)。 9 | 10 | ``` 11 | import tensorflow as tf 12 | import numpy as np 13 | 14 | # 用NumPy創造100個 x, y 的資料點, y = x * 0.1 + 0.3 15 | x_data = np.random.rand(100).astype(np.float32) 16 | y_data = x_data * 0.1 + 0.3 17 | 18 | # 試著找出 y_data = W * x_data + b 的 W 與 b 19 | # (雖然我們知道 W 應是 0.1 且 b 是 0.3, 但讓 Tensorflow 20 | # 為我們處理這件事) 21 | W = tf.Variable(tf.random_uniform([1], -1.0, 1.0)) 22 | b = tf.Variable(tf.zeros([1])) 23 | y = W * x_data + b 24 | 25 | # 最小平方差 26 | loss = tf.reduce_mean(tf.square(y - y_data)) 27 | optimizer = tf.train.GradientDescentOptimizer(0.5) 28 | train = optimizer.minimize(loss) 29 | 30 | # 在開始之前,先透過這行程式碼初始化變數 31 | init = tf.initialize_all_variables() 32 | 33 | # 啟動(run)這個圖 34 | sess = tf.Session() 35 | sess.run(init) 36 | 37 | # 配適(fitting) 38 | for step in xrange(201): 39 | sess.run(train) 40 | if step % 20 == 0: 41 | >print(step, sess.run(W), sess.runn(W), sn(W), s(b)) 42 | 43 | # 找到最佳配適線(best fitting line)是 W: [0.1], b: [0.3] 44 | 45 | ``` 46 | 程式碼的第一部分建立並處理了圖的資料。在Session被建立並且呼叫`run`函數前,TensorFlow並不會真的做任何運算。 47 | 48 | 為了進一步激發你的求知慾,我們建議你先瞧一瞧TensorFlow如何處理一個經典的機器學習問題。在類神經網路的領域中,最經典的問題莫過於手寫數字辨識(handwritten digit classification)問題MNIST了。我們提供了兩篇簡介,分別給機器學習初學者與專家。若您已經利用其他軟體訓練過非常多MNIST模型,請服用紅色藥丸; 如果你從來沒聽過MNIST,那你應該選擇藍色藥丸; 若你認為你介於兩者之間,我們建議你快速瀏覽過藍色藥丸的內容,再服用紅色藥丸。 49 |

50 | 51 |
52 | 53 | 圖片由CC BY-SA 4.0;授權,原作者 W. Carter 54 | 55 | 如果你已經決定要學習並安裝TensorFlow,你可以跳過這些並直接開始後面的章節。不用擔心,你還是可以在未來看到MNIST——我們仍會用MNIST作為說明TensorFlow技術與特色時的範例。 56 | 57 | # 推薦繼續閱讀 58 | 59 | * [下載與安裝](download_and_setup.md) 60 | * [基本操作](basic_usage.md) 61 | * [TensorFlow使用指南](tensorflow_mechanics_101.md) 62 | * [Tinker With a Neural Network Right Here in Your Browser](http://playground.tensorflow.org/#activation=tanh&batchSize=10&dataset=circle®Dataset=reg-plane&learningRate=0.03®ularizationRate=0&noise=0&networkShape=4,2&seed=0.11431&showTestData=false&discretize=false&percTrainData=50&x=true&y=true&xTimesY=false&xSquared=false&ySquared=false&cosX=false&sinX=false&cosY=false&sinY=false&collectStats=false&problem=classification&initZero=false) 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /mandelbrot_set.md: -------------------------------------------------------------------------------- 1 | # 曼德博集合(Mandelbrot Set) 2 | 3 | -------------------------------------------------------------------------------- /mnist_data_download.md: -------------------------------------------------------------------------------- 1 | # MNIST 數據資料下載 2 | 3 | -------------------------------------------------------------------------------- /mnist_for_ml_beginners.md: -------------------------------------------------------------------------------- 1 | # 給機器學習初學者——MNIST 2 | 3 | -------------------------------------------------------------------------------- /partial_differential_equations.md: -------------------------------------------------------------------------------- 1 | # 偏微分方程 2 | 3 | -------------------------------------------------------------------------------- /preface.md: -------------------------------------------------------------------------------- 1 | # 教程 2 | 3 | 4 | 5 | 6 | --- 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /python_api.md: -------------------------------------------------------------------------------- 1 | # Python API 2 | 3 | -------------------------------------------------------------------------------- /reading_data.md: -------------------------------------------------------------------------------- 1 | # 數據讀取 2 | 3 | -------------------------------------------------------------------------------- /recurrent_neural_networks.md: -------------------------------------------------------------------------------- 1 | # 循環神經網路(Recurrent Neural Networks) 2 | 3 | -------------------------------------------------------------------------------- /resources.md: -------------------------------------------------------------------------------- 1 | # Resources 2 | 3 | -------------------------------------------------------------------------------- /sequence-to-sequence_models.md: -------------------------------------------------------------------------------- 1 | # 序列對序列模型(Sequence-to-Sequence Models) 2 | 3 | -------------------------------------------------------------------------------- /sharing_variables.md: -------------------------------------------------------------------------------- 1 | # 變數(Variables)共用 2 | 3 | -------------------------------------------------------------------------------- /syntaxnet_neural_models_of_syntax.md: -------------------------------------------------------------------------------- 1 | # SyntaxNet: 語法的神經模型 2 | 3 | -------------------------------------------------------------------------------- /tensorboard_graph_visualization.md: -------------------------------------------------------------------------------- 1 | # TensorBoard: 圖表視覺化 2 | 3 | -------------------------------------------------------------------------------- /tensorboard_visualizing_learning.md: -------------------------------------------------------------------------------- 1 | # TensorBoard: 視覺化學習 2 | 3 | -------------------------------------------------------------------------------- /tensorflow_mechanics_101.md: -------------------------------------------------------------------------------- 1 | # TensorFlow操作指南 2 | 3 | -------------------------------------------------------------------------------- /tensorflow_serving.md: -------------------------------------------------------------------------------- 1 | # TensorFlow服務 2 | 3 | -------------------------------------------------------------------------------- /testinstallation.md: -------------------------------------------------------------------------------- 1 | # 測試安裝 2 | 3 | ## (Linux選項) 開啟GPU支援 4 | 5 | 如果你先前安裝了GPU版本的TensorFlow,你必須同時安裝Cuda Toolkit 7.5 及 cuDNN v4。請見Cuda安裝。 6 | 7 | 你必須設置 LD_LIBRARY_PATH 及 CUDA_HOME環境變數。 請在`~/.bash_profile` 下加上以下指令,以確保你的CUDA安裝在`/usr/local/cuda`: 8 | 9 | ``` 10 | export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64" 11 | export CUDA_HOME=/usr/local/cuda 12 | ``` 13 | 14 | ## 由命列列啟動TensorFlow 15 | 16 | 若有任何錯誤發生,請見[常見問題]()。 17 | 18 | 打開終端機並輸入以下: 19 | 20 | ``` 21 | $ python 22 | ... 23 | >>> import tensorflow as tf 24 | >>> hello = tf.constant('Hello, TensorFlow!') 25 | >>> sess = tf.Session() 26 | >>> print(sess.run(hello)) 27 | Hello, TensorFlow! 28 | >>> a = tf.constant(10) 29 | >>> b = tf.constant(32) 30 | >>> print(sess.run(a + b)) 31 | 42 32 | >>> 33 | 34 | ``` 35 | 36 | ## 啟動TensorFlow演示模型(demo model) 37 | 38 | 所有的TensorFlow package包括演示模型(demo models)都安裝在Python library。精確的安裝位置根據你的系統不同,但通常是以下之一: 39 | 40 | ``` 41 | /usr/local/lib/python2.7/dist-packages/tensorflow 42 | /usr/local/lib/python2.7/site-packages/tensorflow 43 | 44 | ``` 45 | 你可以利用以下的指令找到所在資料夾(注意: 使用你用來安裝TensorFlow的Python版本,例如如果你是用 Python3 安裝,輸入`python3`而不是`Python`。) 46 | 47 | ``` 48 | $ python -c 'import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))' 49 | 50 | ``` 51 | 這個簡單的手寫數字辨識(handwritten digits classification)演示模型的MNIST數據位於子目錄`models/image/mnist/convolutional.py`。你可以透過以下指令來運行(注意要使用與TensorFlow相同的Python版本)。 52 | 53 | ``` 54 | # 用 'python -m' 來找到程式在Python中的路徑: 55 | $ python -m tensorflow.models.image.mnist.convolutional 56 | Extracting data/train-images-idx3-ubyte.gz 57 | Extracting data/train-labels-idx1-ubyte.gz 58 | Extracting data/t10k-images-idx3-ubyte.gz 59 | Extracting data/t10k-labels-idx1-ubyte.gz 60 | ...etc... 61 | 62 | # 或是你可以直接把這個路徑傳給python的解譯器(interpreter) 63 | # (注意要使用與TensorFlow相同的Python版本 64 | # 例如版本為Python 3: .../python3.X/... ) 65 | $ python /usr/local/lib/python2.7/dist-packages/tensorflow/models/image/mnist/convolutional.py 66 | ... 67 | 68 | ``` 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /threading_and_queues.md: -------------------------------------------------------------------------------- 1 | # 線程與佇列 2 | 3 | -------------------------------------------------------------------------------- /tutor.md: -------------------------------------------------------------------------------- 1 | # tutor 2 | 3 | -------------------------------------------------------------------------------- /using_gpus.md: -------------------------------------------------------------------------------- 1 | # 使用GPU 2 | 3 | -------------------------------------------------------------------------------- /variables_creation,_initializing,_saving,_and_rest.md: -------------------------------------------------------------------------------- 1 | # 變數: 建立、初始化、保存與加載 2 | -------------------------------------------------------------------------------- /vector_representations_of_words.md: -------------------------------------------------------------------------------- 1 | # 詞向量表示(Vector Representations of Words) 2 | 3 | -------------------------------------------------------------------------------- /writing_documentation.md: -------------------------------------------------------------------------------- 1 | # 撰寫TensorFlow的文件(Documentation) 2 | 3 | --------------------------------------------------------------------------------