選自Google Developers Blog機器之心編譯參與:李澤南
昨日,Google Brain 工程師團隊宣布在 TensorFlow 0.12 中加入初步的 Windows 支持。
TensorFlow 宣布開源剛剛過去一年。在谷歌的支持下,TensorFlow 已成為 GitHub 上最受歡迎的機器學習開源項目。同時,谷歌也在 TensorFlow 框架中進行過各類研究、開源了其中一些項目,這些研究涉及到自然語言處理、機器翻譯、圖像描述、圖像分類等等。
谷歌在開發者博客上寫到:「原生的 Windows 版 TensorFlow 是自開源以來,我們工作的重中之重。儘管 Windows 的用戶們已經可以在 Docker 容器中運行 TensorFlow 了,我們仍然希望提供更加完整的原生體驗,包括對於 GPU 的支持。」
隨著 TensorFlow r0.12 版的發布,這一開源軟體庫現已支持 Windows7、10 和 Server 2016。同時,這一新版本可以讓用戶在 TensorFlow 訓練中得到 CUDA 8 的 GPU 加速。我們已將新版本在 PyPI 中封裝成型。現在你可以使用命令 C:\> pip install tensorflow 安裝 TensorFlow 了。
GPU 支持的命令:C:\> pip install tensorflow-gpu
有關 TensorFlow Windows 支持的更多細節請閱讀 r0.12 的版本注釋。
pypi 地址:
https://pypi.python.org/pypi/tensorflow
TensorFlow Release 0.12.0 地址:
https://github.com/tensorflow/tensorflow/releases
主要特性和提升:
TensorFlow 現在可以在 Microsoft Windows 中開發和運行了(已知在 Windows 10、Windows 7、Windows Server 2016 中運行良好)。支持的語言包括 Python(通過 pip package)和 C++。支持 CUDA 8.0 和 cuDNN5.1 GPU 加速。目前已知的限制有:現在無法加載自定義指令庫(custom op library)。不支持 CGS 和 HDFS 文件系統。下列指令無法實現:DepthwiseConv2dNative, DepthwiseConv2dNativeBackpropFilter, DepthwiseConv2dNativeBackpropInput, Dequantize, Digamma, Erf, Erfc, Igamma, Igammac, Lgamma, Polygamma, QuantizeAndDequantize, QuantizedAvgPool, QuantizedBatchNomWithGlobalNormalization, QuantizedBiasAdd, QuantizedConcat, QuantizedConv2D, QuantizedMatmul, QuantizedMaxPool, QuantizeDownAndShrinkRange, QuantizedRelu, QuantizedRelu6, QuantizedReshape, QuantizeV2, RequantizationRange, 和 Requantize。Go:Go 中的實驗 API 可以創建和執行圖表(https://godoc.org/github.com/tensorflow/tensorflow/tensorflow/go)新的 checkpoint 格式現在是 tf.train.Saver 中的默認值。舊 V1 chekpoint 仍然可讀; 由 write_version 參數控制,tf.train.Saver 現在默認寫入新的 V2 格式。這種方式顯著降低了恢復期間所需的內存峰值,同時降低了延遲。為無矩陣(迭代)解算器增加了新的庫,支持 tensorflow/contrib/solvers 中的線性方程、線性最小二乘法,特徵值和奇異值。最初的版本具有 lanczos 雙對角化(bidiagonalization)、共軛梯度和 CGLS。為 matrix_solve_ls 和 self_adjoint_eig 增加了梯度。對原有內容進行了大量清理,為具有 C ++梯度的運算添加二階梯度,並改進現有梯度,使大多數運算現在可以多次微分。增加了常微分方程的求解器:tf.contrib.integrate.odeint。用於具有命名軸的張量的新 contrib 模塊,tf.contrib.labeled_tensor。TensorBoard 中嵌入(embedding)的可視化。
主要 API 改進
BusAdjacency 枚舉被協議緩衝 DeviceLocality 代替。總線索引現在從 1 而不是 0 開始,同時,使用 bus_id==0,之前為 BUS_ANY。Env::FileExists 和 FileSystem::FileExists 現在返回 tensorflow::Status 而不是一個 bool。任何此函數的調用者都可以通過向調用添加.ok()將返迴轉換為 bool。C API:TF_SessionWithGraph 類型更名為 TF_Session,其在 TensorFlow 的綁定語言中成為首選。原來的 TF_Session 已更名為 TF_DeprecatedSession。C API: TF_Port 被更名為 TF_Output。C API: 調用者保留提供給 TF_Run、 TF_SessionRun、TF_SetAttrTensor 等的 TF_Tensor 對象的所有權。將 tf.image.per_image_whitening() 更名為 tf.image.per_image_standardization()。將 Summary protobuf 構造函數移動到了 tf.summary 子模塊。不再使用 histogram_summary、audio_summary、 scalar_summary,image_summary、merge_summary 和 merge_all_summaries。組合 batch_ *和常規版本的線性代數和 FFT 運算。常規運算現在也處理批處理。所有 batch_ * Python 接口已刪除。tf.all_variables,tf.VARIABLES 和 tf.initialize_all_variables 更名為 tf.global_variables,tf.GLOBAL_VARIABLES 和 tf.global_variable_initializers respectively。
Bug 修復和其他的變化
使用線程安全版本的 lgamma 函數。修復 tf.sqrt 負參數。修正了導致用於多線程基準的線程數不正確的錯誤。多核 CPU 上 batch_matmul 的性能優化。改進 trace,matrix_set_diag,matrix_diag_part 和它們的梯度,適用於矩形矩陣。支持復值矩陣的 SVD。