Tag Archives: TensorFlow

[ 翻譯 ] 2018.08.03-根據TensorFlow團隊,TensorFlow 1.9正式支援樹莓派


Pete Warden




感謝作者Pete Warden的授權翻譯,特此致謝!

When TensorFlow was first launched in 2015, we wanted it to be an “open source machine learning framework for everyone”. To do that, we need to run on as many of the platforms that people are using as possible. We’ve long supported Linux, MacOS, Windows, iOS, and Android, but despite the heroic efforts of many contributors, running TensorFlow on a Raspberry Pi has involved a lot of work. Thanks to a collaboration with the Raspberry Pi Foundation, we’re now happy to say that the latest 1.9 release of TensorFlow can be installed from pre-built binaries using Python’s pip package system! If you’re running Raspbian 9 (stretch), you can install it by running these two commands from a terminal:

當TensorFlow於2015年首次發佈時,我們希望它是一個「給所有人的開源機器學習框架」。爲要達成這一點,我們需要盡可能讓它在更多人們使用的平台上運作,所以,我們長期以來支援了Linux、MacOS、Windows、iOS及Android等作業系統。然而,儘管許多貢獻者已經貢獻卓越,在Raspberry Pi上運行TensorFlow仍有許多工作需要完成。感謝與Raspberry Pi基金會的合作,我們現在很高興能宣佈:最新的TensorFlow 1.9版,可透過Python的pip套件系統來安裝建置好的二元檔了!若您正使用Raspbian 9(Raspbian stretch),只要從終端機輸入下面這兩道指令來安裝它:


sudo apt install libatlas-base-dev
pip3 install tensorflow


You can then run python3 in a terminal, and use TensorFlow just as you would on any other platform. Here’s a simple hello world example:

接下來,您可在終端機上運作python3,並如同在任何其它平台上一樣使用TensorFlow。下面是一個簡單的hello world範例:


# Python
import tensorflow as tf
hello = tf.constant(‘Hello, TensorFlow!’)


If the system outputs the following, then you are ready to begin writing TensorFlow programs:

Hello, TensorFlow!

如果看到以下內容:Hello, TensorFlow!, 那您便可開始編寫TensorFlow的程式。


There are more details on installing and troubleshooting TensorFlow on the Raspberry Pi on the TensorFlow website.



We’re excited about this because the Raspberry Pi is used by many innovative developers, and is also widely used in education to introduce people to programming, so making TensorFlow easier to install will help open up machine learning to new audiences. We’ve already seen platforms like DonkeyCar use TensorFlow and the Raspberry Pi to create self-driving toy cars, and we can’t wait to discover what new projects will be built now that we’ve reduced the difficulty.

我們對這件事感到很興奮,因為Raspberry Pi早已被許多創新開發者使用著,也被廣泛應用於教育領域來推廣程式教育。所以,讓TensorFlow更容易安裝於Raspberry Pi上,將有助於新朋友認識何謂機器學習。我們已經看到像 DonkeyCar 這樣的平台使用TensorFlow與Raspberry Pi來做出能夠自動駕駛的玩具小車。我們也迫不及待想知道,在使用難度降低之後,會有哪些新專案誕生。


Eben Upton, founder of the Raspberry Pi project, says, “It is vital that a modern computing education covers both fundamentals and forward-looking topics. With this in mind, we’re very excited to be working with Google to bring TensorFlow machine learning to the Raspberry Pi platform. We’re looking forward to seeing what fun applications kids (of all ages) create with it,” and we agree!

Raspberry Pi創辦人Eben Upton表示:「現今的電腦程式教育必須涵蓋基礎知識與前瞻性的主題。考慮到這一點,我們非常興奮能與Google合作,將TensorFlow機器學習引入Raspberry Pi平台。我們期待看見所有年齡層的孩子們能運用它來打造各種有趣的應用。」這,我們完全同意!


We’re hoping to see a lot more educational material and tutorials emerge that will help more and more people explore the possibilities of machine learning on such a cost-effective and flexible device.

我們深切盼望看見更多教材和教學資源問世,幫助更多人在Raspberry Pi這款高CP值又具備擴充彈性的裝置上探索機器學習的各種可能性。





[翻譯] 2018.8.14-根據TensorFlow團隊,TensorFlow 2.0預覽版預計於下半年發佈(繁、簡中文版)


Martin Wicke





Since the open-source release in 2015, TensorFlow has become the world’s most widely adopted machine learning framework, catering to users and use-cases. In this time, TensorFlow has evolved along with rapid developments in computing hardware, machine learning research, and commercial deployment.






Reflecting these rapid changes, we have started work on the next major version of TensorFlow. TensorFlow 2.0 will be a major milestone, with a focus on ease of use. Here are some highlights of what users can expect with TensorFlow 2.0:

  • Eager execution will be a central feature of 2.0. It aligns users’ expectations about the programming model better with TensorFlow practice and should make TensorFlow easier to learn and apply.
  • Support for more platforms and languages, and improved compatibility and parity between these components via standardization on exchange formats and alignment of APIs.
  • We will remove deprecated APIs and reduce the amount of duplication, which has caused confusion for users.


爲回應這股快速變遷的趨勢,我們(TensorFlow團隊)已開始研發TensorFlow下一個主要版本。TensorFlow 2.0將會是重要的里程碑,著眼於讓大家更容易使用。以下是一些使用者可期盼的焦點:

  • Eager execution將會是0版本的中心特色,它能滿足使用者對於實做更棒的程式模型的期待,並且應該會使TensorFlow更易於學習及應用。
  • 支援更多的平台及語言,亦改善了相容性,並且透過交換格式及API調整的標準化,在這些元件中取得平衡。
  • 我們將會移除已棄用的API,並且降低重複性,避免造成使用者混淆。


为回应这股快速变迁的趋势,我们(TensorFlow团队)已开始研发TensorFlow下一个主要版本。 TensorFlow 2.0将会是重要的里程碑,着眼于让大家更容易使用。以下是一些使用者可期盼的焦点:

  • Eager execution将会是0版本的中心特色,它能满足使用者对于实做更棒的程式模型的期待,并且应该会使TensorFlow更易于学习及应用。
  • 支援更多的平台及语言,亦改善了相容性,并且透过交换格式及API调整的标准化,在这些元件中取得平衡。
  • 我们将会移除已弃用的API,并且降低重复性,避免造成使用者混淆。


We are planning to release a preview version of TensorFlow 2.0 later this year.


我們預計於2018年下半年發佈TensorFlow 2.0的預覽版本。


我们预计于2018年下半年发布TensorFlow 2.0的预览版本。


Public 2.0 design process

Shortly, we will hold a series of public design reviews covering the planned changes. This process will clarify the features that will be part of TensorFlow 2.0, and allow the community to propose changes and voice concerns. Please join developers@tensorflow.org if you would like to see announcements of reviews and updates on process. We hope to gather user feedback on the planned changes once we release a preview version later this year.


公開的 TensorFlow 2.0設計程序

簡而言之,我們將針對已在計劃中的更新有一系列的「公開設計評論」。這個過程會說明那些即將納入TensorFlow 2.0中的功能,並且允許社群提出修改且表達關切。若您想得知評論的公告與設計過程的進展,請加入developers@tensorflow.org。一旦預覽版本於2018年下半年發佈之後,我們期盼收到使用者對於計畫中的更新的回饋意見。


公开的 TensorFlow 2.0设计程序

简而言之,我们将针对已在计划中的更新有一系列的「公开设计评论」。这个过程会说明那些即将纳入TensorFlow 2.0中的功能,并且允许社群提出修改且表达关切。若您想得知评论的公告与设计过程的进展,请加入developers@tensorflow.org。一旦预览版本于2018年下半年发布之后,我们期盼收到使用者对于计画中的更新的回馈意见。


Compatibility and continuity

TensorFlow 2.0 is an opportunity to correct mistakes and to make improvements which are otherwise forbidden under semantic versioning.



TensorFlow 2.0的發佈是一個改正錯誤的好機會,並且針對在semantic versioning下被禁止的部分作出改善。



TensorFlow 2.0的发布是一个改正错误的好机会,并且针对在semantic versioning下被禁止的部分作出改善。


To ease the transition, we will create a conversion tool which updates Python code to use TensorFlow 2.0 compatible APIs, or warns in cases where such a conversion is not possible automatically. A similar tool has helped tremendously in the transition to 1.0.


為減緩過渡時期的衝擊,我們將提供一個轉換工具,它具備兩項功能:(1)更新Python程式碼得以使用相容於TensorFlow 2.0的API;(2)假如轉換無法完全自動完成時,將發出警告。類似的工具在當年轉換到Tensorflow1.0版時可真是幫了大忙呢。


为减缓过渡时期的冲击,我们将提供一个转换工具,它具备两项功能:(1)更新Python程式码得以使用相容于TensorFlow 2.0的API;(2)假如转换无法完全自动完成时,将发出警告。类似的工具在当年转换到Tensorflow1.0版时可真是帮了大忙呢。


Not all changes can be made fully automatically. For example, we will be deprecating APIs, some of which do not have a direct equivalent. For such cases, we will offer a compatibility module (tensorflow.compat.v1) which contains the full TensorFlow 1.x API, and which will be maintained through the lifetime of TensorFlow 2.x.


並非所有的更新皆可全部自動完成。例如以棄用API來說,有些將要被棄用的API並沒有一個直接可對應的應用程式去處理。針對這樣的情況,我們將提供一套相容性模組(tensorflow.compat.v1),包含完整的TensorFlow 1.x API,並且確保它在TensorFlow 2.0的產品週期中被維護。


并非所有的更新皆可全部自动完成。例如以弃用API来说,有些将要被弃用的API并没有一个直接可对应的应用程式去处理。针对这样的情况,我们将提供一套相容性模组(tensorflow.compat.v1),包含完整的TensorFlow 1.x API,并且确保它在TensorFlow 2.0的产品周期中被维护。


We do not anticipate any further feature development on TensorFlow 1.x once a final version of TensorFlow 2.0 is released. We will continue to issue security patches for the last TensorFlow 1.x release for one year after TensorFlow 2.0’s release date.


一旦TensorFlow 2.0最終版本發佈後,就不會在開發任何TensorFlow 1.x的功能了。我們將在TensorFlow 2.0發佈一年之內,針對TensorFlow 1.x的最新版持續提供安全性修正程式(Security Patch)。


一旦TensorFlow 2.0最终版本发布后,就不会在开发任何TensorFlow 1.x的功能了。我们将在TensorFlow 2.0发布一年之内,针对TensorFlow 1.x的最新版持续提供安全性修正程式(Security Patch)。


On-disk compatibility

We do not intend to make breaking changes to SavedModels or stored GraphDefs (i.e., we plan to include all current kernels in 2.0). However, the changes in 2.0 will mean that variable names in raw checkpoints might have to be converted before being compatible with new models.



我們無意針對SavedModels或儲存的GraphDefs做出大幅度的修改。(例如,我們想在TensorFlow 2.0中納入所有現行的核心。)然而,在TensorFlow 2.0中的更新代表在原始檢查點中的變數名稱,在順利相容於新模型前可能需要進行轉換。



我们无意针对SavedModels或储存的GraphDefs做出大幅度的修改。 (例如,我们想在TensorFlow 2.0中纳入所有现行的核心。)然而,在TensorFlow 2.0中的更新代表在原始检查点中的变数名称,在顺利相容于新模型前可能需要进行转换。



TensorFlow’s contrib module has grown beyond what can be maintained and supported in a single repository. Larger projects are better maintained separately, while we will incubate smaller extensions along with the main TensorFlow code. Consequently, as part of releasing TensorFlow 2.0, we will stop distributing tf.contrib. We will work with the respective owners on detailed migration plans in the coming months, including how to publicise your TensorFlow extension in our community pages and documentation. For each of the contrib modules we will either a) integrate the project into TensorFlow; b) move it to a separate repository or c) remove it entirely. This does mean that all of tf.contrib will be deprecated, and we will stop adding new tf.contrib projects today. We are looking for owners/maintainers for a number of projects currently in tf.contrib, please contact us (reply to this email) if you are interested.



TensorFlow的contrib模組的規模已超過可在單一版本庫中維護並支援的程度。較大的專案最好是獨立維護,同時我們會讓較小的擴充檔去跟著TensorFlow主線去走。結論是,作為發佈TensorFlow 2.0過程的一部分,我們將停止發佈tf.contrib。我們會在這幾個月之內針對個別擁有者去敲定遷移的細節,包括如何在我們的社群網頁和文件中宣傳您的TensorFlow擴充。針對每一個補充支援模組,我們將採取以下三項措施中的一項:







TensorFlow的contrib模组的规模已超过可在单一版本库中维护并支援的程度。较大的专案最好是独立维护,同时我们会让较小的扩充档去跟着TensorFlow主线去走。结论是,作为发布TensorFlow 2.0过程的一部分,我们将停止发布tf.contrib。我们会在这几个月之内针对个别拥有者去敲定迁移的细节,包括如何在我们的社群网页和文件中宣传您的TensorFlow扩充。针对每一个补充支援模组,我们将采取以下三项措施中的一项:






Next steps

For questions about development of or migration to TensorFlow 2.0, contact us at discuss@tensorflow.org. To stay up to date with the details of 2.0 development, please subscribe to developers@tensorflow.org, and participate in related design reviews.



針對TensorFlow 2.0的開發或轉的的相關問題,請來信discuss@tensorflow.org 詢問。若想要得知TensorFlow 2.0的最新進度,請訂閱developers@tensorflow.org ,並且參與相關的設計評論,謝謝。



针对TensorFlow 2.0的开发或转的的相关问题,请来信discuss@tensorflow.org 询问。若想要得知TensorFlow 2.0的最新进度,请订阅developers@tensorflow.org ,并且参与相关的设计评论,谢谢。


On behalf of the TensorFlow team,