国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

【TensorFlow | 升級】TensorFlow 1.0 發布

2019-11-08 18:23:23
字體:
來源:轉載
供稿:網友

前面寫了 TensorFlow 在Windows上的安裝教程,當時版本還是 0.12 。

NOW

首屆 TensorFlow 開發者大會(TensorFlow Dev Summit)已于美國時間昨日召開,YouTube 還進行了直播。更重要的是,TensorFlow 1.0 版本發布。Google Research Blog 也于昨天在 博客 中公布了這一消息。

這里寫圖片描述


改動

這一版本的改動還是比較大的,很多舊的 API 都已經不再使用。在 博客 中可以看到 1.0 版本更快、更靈活、更穩定(PRoduction-ready) 。TensorFlow 1.0 版本保證 Python API 的穩定性,即使以后添加新的特性也不用擔心會破壞現有代碼。

博客中提到的其他新版本兩點(為避免翻譯造成的偏差,我就直接引用原文了):

Python APIs have been changed to resemble NumPy more closely. For this and other backwards-incompatible changes made to support API stability going forward, please use our handy migration guide and conversion script.Experimental APIs for java and GoHigher-level API modules tf.layers, tf.metrics, and tf.losses - brought over from tf.contrib.learn after incorporating skflow and TF SlimExperimental release of XLA, a domain-specific compiler for TensorFlow graphs, that targets CPUs and GPUs. XLA is rapidly evolving - expect to see more progress in upcoming releases.Introduction of the TensorFlow Debugger (tfdbg), a command-line interface and API for debugging live TensorFlow programs.New Android demos for object detection and localization, and camera-based image stylization.Installation improvements: Python 3 docker images have been added, and TensorFlow’s pip packages are now PyPI compliant. This means TensorFlow can now be installed with a simple invocation of pip install tensorflow.

升級

升級很簡單(在這里感謝一下為簡化 TensorFlow 安裝過程的工程師們),就是一行語句,這也是安裝命令:

對于 GPU 版本:

pip3 install --upgrade tensorflow-gpu

對于 CPU 版本:

pip3 install --upgrade tensorflow

升級過程 右鍵在新標簽頁打開圖片可查看大圖

輸入完回車就開始升級過程,會下載并卸載重裝一些必要的包,時間長短視網速而定。


更新你的舊代碼

有兩種方法更新你的代碼,一種就是我上面提到的用腳本自動升級,另一種就是手動更改,具體可以參考 這里 。

使用腳本

由于版本改動較大,TensorFlow 甚至出了一個 tf_upgrade.py 腳本來幫助你更新代碼,從 這里 獲取這份代碼,或者點擊 這里 直接下載。

對于更新單個文件,可以使用下面的命令:

python tf_upgrade.py --infile InputFile --outfile OutputFile

其中 InputFileOutputFile 分別為你的舊代碼和新代碼,根據你的文件名做相應的替換。例如我的舊代碼是 test.py,將要生成的新代碼是 test_1.0.py,則:

python tf_upgrade.py --infile test.py --outfile test_1.0.py

同時,tf_upgrade.py 會生成一個名為 report.txt 的文件,該文件記錄了對舊文件做的所有改動,同時也給出了可能需要你手動更改的建議。

對于文件夾(目錄),和單個文件類似,使用

python tf_upgrade.py --intree InputDir --outtree OutputDir

例如,我的 programs 位于 /home/user/cool 目錄,新的生成的文件我想放到 /home/user/cool_1.0 里,則

python tf_upgrade.py --intree /home/user/cool --outtree /home/user/cool_1.0

手動更改

除了使用腳本自動更新外,還可以使用手動替換的方式。需要替換的東西有很多,我就不一一列舉了,大家可以參考 官網 。


END


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 靖西县| 酉阳| 鄢陵县| 玉林市| 福贡县| 新密市| 同仁县| 牙克石市| 岱山县| 克拉玛依市| 霍林郭勒市| 武宁县| 洪洞县| 武乡县| 祥云县| 泉州市| 环江| 瑞金市| 德令哈市| 潮安县| 柳林县| 望奎县| 揭西县| 成都市| 湟源县| 泽普县| 临桂县| 连州市| 白水县| 泽库县| 仪陇县| 安陆市| 云安县| 馆陶县| 安康市| 九寨沟县| 湘西| 大兴区| 贡嘎县| 故城县| 祁连县|