前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >官宣!TensorFlow 2.0 正式发布

官宣!TensorFlow 2.0 正式发布

作者头像
AI研习社
发布2019-10-08 17:21:03
8340
发布2019-10-08 17:21:03
举报
文章被收录于专栏:AI研习社AI研习社AI研习社
本文来自

今年初,我们在 TensorFlow 开发者大会 (TensorFlow Dev Summit) 上发布了 TensorFlow 2.0 的 Alpha 版本。经过近 7 个月的努力,今天我们高兴的宣布,TensorFlow 2.0 正式版现已推出!

注:TensorFlow 开发者大会 链接

https://tensorflow.google.cn/dev-summit

TensorFlow 2.0 安装 链接

https://tensorflow.google.cn/install

TensorFlow 2.0 由社区推动,社区的声音让我们了解到开发者需求的是一个灵活、强大且易于使用的平台,并且支持部署到任何平台上。TensorFlow 2.0 为开发者、企业与研究人员提供了一个全面的生态系统,以推动最先进的机器学习研究与构建大规模的机器学习应用。

Coding with TensorFlow 2.0

TensorFlow 2.0 让 ML 应用的开发变得更容易。Keras 与 Eager Execution 更紧密地结合至 TensorFlow 并成为默认选项,并以原生 Python 的方式执行函数,TensorFlow 2.0 让开发应用的体验变得更接近于原生 Python 开发。对于想要推进机器学习进步的研究人员,我们在 TensorFlow 底层 API 上投入了大量精力:我们暴露了内部使用的所有算子 (ops),并且为关键概念(如变量和 checkpoints)提供了可继承的接口。这允许开发者基于 TensorFlow 内部方法进行开发,而不必重新编译 TensorFlow。

注:Keras with TensorFlow 链接

https://tensorflow.google.cn/guide/keras/overview

Eager Execution 链接

https://tensorflow.google.cn/guide/eager

为了能够在不同运行时环境(如云、Web、浏览器、Node.js、移动端以及嵌入式系统)中运行模型,我们使用了标准化的文件结构 SavedModel 。让开发者在TensorFlow 中运行模型的同时,可以通过 TensorFlow Serving 部署模型,通过 TensorFlow Lite 部署至移动或嵌入式系统中,并且在浏览器或 Node.js 中使用 TensorFlow.js 训练和运行模型。

对于高性能训练场景,您可以使用 Distribution Strategy API 进行分布训练,修改少量代码并获得出色的开箱即用 (out-of-the-box) 性能。支持使用 Keras Model.fit 进行分布式训练,并支持自定义训练循环 (custom training loops)。此外,现已提供多 GPU 支持。

注:Distribution Strategy API 链接

https://tensorflow.google.cn/guide/distributed_training

多 GPU 支持 链接

https://tensorflow.google.cn/guide/gpu

TensorFlow 2.0 在 GPU 性能提升上也作出了很多努力。TensorFlow 2.0 通过使用 Volta 与 Turing GPU 混合精度,仅需几行代码,即可提升 3 倍训练性能(可见ResNet-50 与 BERT 模型的示例)。TensorFlow 2.0 紧密结合了 TensorRT ,通过使用改进的 API,提升了 NVIDIA T4 Cloud GPUs 在谷歌云的可用性与性能。

注:改进的 API 链接

https://github.com/tensorflow/tensorflow/blob/r2.0/tensorflow/python/compiler/tensorrt/trt_convert.py#L766-L859

NVIDIA T4 Cloud GPUs 链接

https://cloud.google.com/compute/docs/tutorials/ml-inference-t4

“ 在 Nvidia 的 GPU 和系统上进行的机器学习,让开发者解决几年前看似不可能解决的问题成为可能”, NVIDIA 加速计算软件产品管理高级主管 Kari Briski 说。“Tensorflow 2.0 包含了许多出色的 GPU 加速功能,我们迫不及待地想看到社区开发者们使用这些先进的工具创建出的令人惊叹的 AI 应用程序。”

在使用 TensorFlow 建模时,有效获取训练和验证数据至关重要。为此,我们引入了 TensorFlow Datasets ,为包含多种数据类型(如图像、文本、视频等)的大量数据集提供了标准接口。

虽然我们仍保留了传统的基于会话(Session)的开发模式,但我们建议使用基于 Eager Execution 的更接近原生 Python 的开发模式。使用 tf.function 将代码转换为可远程执行、序列化和性能优化的计算图。此外,Autograph 还可以将常规的 Python 控制流直接转换为 TensorFlow 控制流。

当然,如果您使用过 TensorFlow 1.x 并正在寻找 2.0 的迁移指南,我们也已经在此发布。TensorFlow 2.0 正式版还包含一个自动转换脚本以帮助您入门。

我们已经与 Google 内部及 TensorFlow 社区的许多用户进行了合作,以测试 TensorFlow 2.0 的功能,我们为收集到的反馈感到高兴:如 Google News 团队在 TensorFlow 2.0 中使用了基于 BERT 的语言理解模型,该模型大大提高了报道的覆盖率。TensorFlow 2.0 提供的灵活且易于使用的 API,可快速将新想法落地。模型培训和服务已无缝集成到现有基础架构中。

注:提升报道覆盖率 链接

https://www.blog.google/products/news/new-google-news-ai-meets-human-intelligence/

此外,ML 不仅适用于 Python 开发者 —— 有了 TensorFlow.js,JavaScript开发者也可以使用 TensorFlow 进行训练和推理,并且我们也持续在 Swift 上进行投入,通过 Swift for TensorFlow 使其作为一种构建模型的语言。

还有很多值得介绍的功能,为了帮助大家快速了解这些新功能,我们为 TensorFlow 2.0 中的所有新功能创建了便捷指南。不仅如此,为了使 TensorFlow 2.0 入门更加容易,我们在还发布了使用2.0 API 的几种常用 ML 模型的参考实现。

在线课程:要了解如何使用 TensorFlow 2.0 构建应用程序,请查看我们与 deeplearning.ai 和 Udacity 一起创建的在线课程。

  • deeplearning.ai: https://www.coursera.org/learn/introduction-tensorflow
  • Udacity: https://www.udacity.com/course/intro-to-tensorflow-for-deep-learning--ud187

快速上手:请尝试使用 Google Cloud’s Deep Learning VM Images (https://cloud.google.com/deep-learning-vm/) —— 无需进行设置,预先配置的虚拟机即可帮助您构建 TensorFlow 2.0 深度学习项目。

了解更多

前往 tensorflow.google.cn 进一步了解 TensorFlow 2.0,包括如何下载和开始编写 ML 应用程序。最后,关于 TensorFlow 2.0 及其生态系统的更多激动人心的公告、演讲、实践课程和展示,请亲自参加 10 月 28 日至 31 日在加利福尼亚州圣克拉拉的 TensorFlow World (http://tensorflow.world/)。我们期待与您相遇!

如果您想详细了解 TensorFlow 的相关内容,请参阅以下文档。这些文档深入探讨了这篇文章中提及的许多主题:

  • TensorFlow 2.0 安装 (https://tensorflow.google.cn/install)
  • Keras with TensorFlow 链接 (https://tensorflow.google.cn/guide/keras/overview)
  • Eager Execution 链接 (https://tensorflow.google.cn/guide/eager)
  • SavedModel (https://tensorflow.google.cn/guide/saved_model)
  • TensorFlow Serving (https://tensorflow.google.cn/tfx/guide/serving)
  • TensorFlow Lite (https://tensorflow.google.cn/lite)
  • TensorFlow JS (https://tensorflow.google.cn/js)
  • Distribution Strategy API 链接 (https://tensorflow.google.cn/guide/distributed_training)
  • 在Google Cloud 上使用 GPU (https://cloud.google.com/compute/docs/gpus/)
  • 分布式训练指导 (https://tensorflow.google.cn/guide/distributed_training)
  • 模型示例:ResNet-50 (https://github.com/tensorflow/models/tree/master/official/resnet)
  • 模型示例:BERT 示例 (https://github.com/tensorflow/models/tree/master/official/nlp/bert)
  • TensorFlow Datasets 链接 (https://tensorflow.google.cn/guide/data)
  • tf.function 链接 (https://tensorflow.google.cn/tutorials/customization/performance)
  • Autograph 链接 (https://tensorflow.google.cn/guide/function)
  • 迁移指南 (https://tensorflow.google.cn/guide/migrate)
  • Swift for TensorFlow (https://tensorflow.google.cn/swift)
  • 便捷指南 (https://tensorflow.google.cn/guide/effective_tf2)
  • 常用 ML 模型的参考实现 (https://tensorflow.google.cn/resources/models-datasets)
本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-10-02,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 AI研习社 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档