TensorFlow 1.7 Released: An In-Depth Look at the Latest Major Update

TensorFlow, Google‘s flagship open-source library for machine learning and deep learning, continues to evolve at a rapid pace. In March 2018, the TensorFlow team released version 1.7, representing one of the biggest updates in the history of the project. Packing in new features and performance enhancements, TensorFlow 1.7 makes it easier than ever to build and deploy state-of-the-art neural networks at scale.

In this article, we‘ll take a deep dive into everything you need to know about TensorFlow 1.7. We‘ll cover:

  • The significance of the TensorFlow 1.7 release
  • Key new features and updates, including the TensorFlow Debugger UI, eager execution, and TensorRT optimizations
  • Benchmark results highlighting performance gains
  • How to get started with TF 1.7
  • What this release means for the future of TensorFlow

Whether you‘re a TensorFlow veteran or relatively new to the library, this guide will help you get up to speed on all the exciting developments in the 1.7 release. Let‘s jump in!

Why TensorFlow 1.7 Is a Major Milestone

Since its initial open-source release in 2015, TensorFlow has rapidly become one of the most popular deep learning libraries in the world. It powers cutting-edge machine learning applications at Google and a variety of other major tech companies and research institutions.

TensorFlow‘s rise to prominence is due to several factors:

  • Highly scalable architecture for training and deploying models in production
  • Extensive functionality covering all aspects of modern deep learning workflows
  • Strong documentation and vibrant open-source community
  • Backed by and battle-tested at Google

Each incremental update to TensorFlow expands on these strengths while making the library more flexible and accessible to a wider audience. TensorFlow 1.7 represents a milestone release on several fronts.

First, it offers substantial performance gains, particularly for deploying models in production. Through integration with Nvidia‘s TensorRT library for GPU inference optimization, TF 1.7 enables ResNet-50 models to run up to 8X faster with sub-7ms latency compared to the previous version. For companies deploying TensorFlow models at scale, these speedups translate into major efficiency and cost savings.

Second, the 1.7 release vastly improves the user experience for debugging and visualizing TensorFlow models. The new TensorFlow Debugger Plugin offers an interactive, graphical interface for stepping through model execution and visualizing internal tensor values and code relationships. This marks a major step forward in TensorFlow‘s tooling and makes it far easier to inspect and debug complex models.

Third, while it‘s still considered experimental, TF 1.7 takes a huge leap in making eager execution a first-class citizen within the library. Eager execution allows for a more natural, imperative coding style that is intuitive to Python developers. In future releases, eager execution is expected to become the default mode for TensorFlow development, lowering the barrier to entry.

A Closer Look at TensorFlow 1.7 Features and Enhancements

Let‘s now dive deeper into the specific features and improvements available in TensorFlow 1.7.

Debugging and Visualization with TensorFlow Debugger UI

The biggest highlight for many TensorFlow users will undoubtedly be the introduction of a graphical user interface for the TensorFlow debugger (tfdbg). While tfdbg itself has been around for over a year, previous versions were limited to a command-line interface that made the debugging experience quite cumbersome.

With TensorFlow 1.7, you can now use tfdbg‘s features through an interactive, web-based dashboard. The debugger UI allows you to:

  • Pause execution and step through model graphs node by node
  • Visualize the state of tensors as execution progresses
  • Set breakpoints and inspect values based on conditional triggers
  • Track down which lines of Python code constructed particular tensors and ops
  • Analyze the performance of individual graph nodes

Even for experienced TensorFlow developers, debugging model graphs has been a major challenge and productivity sink to date. The new tfdbg user interface makes it far easier to visualize the complex flow of tensor computations and pinpoint bugs or inefficiencies. It‘s a huge step up in usability.

TensorFlow Debugger UI example

Eager Execution Graduates from Contrib

Eager execution is another area where TensorFlow 1.7 makes strides (though it remains experimental for now). First introduced in contrib in TF 1.5, eager execution provides an imperative programming model for TensorFlow as an alternative to the standard declarative graph approach.

With eager execution enabled (via tf.enable_eager_execution()), TensorFlow ops execute immediately as they are called from Python. This allows for a more intuitive development workflow, as results can be inspected interactively without needing to run a tf.Session.

In TensorFlow 1.7, eager execution has been promoted out of contrib, signaling that it‘s one step closer to being ready for primetime. It‘s still not recommended for production deployments, but the TF developers have made it clear that eager execution will play a central role in the library‘s future.

As more users start building models with eager execution, we can expect to see richer debugging and visualization tools built on top of it, a more streamlined path to exporting and serving models, and better integration with other parts of the TensorFlow API. It will be exciting to see how eager execution matures and impacts the TensorFlow workflow in future releases.

Accelerating Inference with TensorRT Integration

Over the past year, Nvidia has been hard at work integrating its TensorRT library with popular deep learning frameworks to help optimize neural networks for inference on Nvidia hardware. In the TensorFlow 1.7 release, the TensorFlow team worked closely with Nvidia to bake TensorRT support directly into the library.

TensorRT performs a variety of optimizations to generate highly efficient inference code specifically for Nvidia GPUs. Through layer and tensor fusion, kernel auto-tuning, and FP16/INT8 precision calibration, TensorRT can dramatically accelerate the execution of trained models.

According to benchmarks from Google, the TensorFlow-TensorRT integration enables ResNet-50 models to perform inference up to 8X faster on Nvidia Volta GPUs compared to running TensorFlow alone. For a batch size of 128 on an Nvidia Tesla V100 GPU, ResNet-50 is able to perform inference in under 7 milliseconds per image. These are impressive performance gains that will help developers deploy large-scale TensorFlow models more efficiently.

ResNet-50 inference benchmarks with TensorFlow-TensorRT integration

It‘s worth noting that TensorRT integration is still a work in progress, with a somewhat limited set of TensorFlow ops supported so far. The TensorFlow team is actively working to expand TensorRT support to cover more use cases with each subsequent release.

Simplifying Input Pipelines with tf.data Improvements

Training large, complex neural networks requires huge datasets that often can‘t fit in memory all at once. TensorFlow offers the tf.data API to help build input pipelines for streaming data from disk and applying transformations on the fly.

The TensorFlow 1.7 release offers several enhancements to make tf.data pipelines more flexible and performant:

  • tf.contrib.data.make_saveable_from_iterator for saving iterator state across checkpoints
  • tf.contrib.data.bucket_by_sequence_length for bucketing variable-length sequences
  • tf.contrib.data.SqlDataset for constructing input pipelines from SQL databases

With these new capabilities, it becomes easier to fine-tune input pipelines for I/O bottlenecks and seamlessly handle large datasets that would otherwise be unwieldy to work with.

Additional TensorFlow 1.7 Updates

Beyond the major features outlined above, TensorFlow 1.7 packs in several additional updates:

  • Improved support for quantized models with new AQT tools for simulating quantization during training
  • Better control over gradient computation with tf.custom_gradient
  • More distributed training features, including a distributed Multi-GPU CollectiveAllReduceStrategy
  • Overview page in TensorBoard for visualizing model graphs and statistics at a high level

Getting Started with TensorFlow 1.7

If you‘re itching to try out all the new features in TensorFlow 1.7, installing or upgrading is easy. The release is available through several different methods.

To install TensorFlow 1.7 with CPU-only support:

pip install tensorflow==1.7.0

To install with GPU support:

pip install tensorflow-gpu==1.7.0

Docker images are also available from the TensorFlow repository:

docker pull tensorflow/tensorflow:1.7.0

If you‘re running a previous version of TensorFlow, you can upgrade with:

pip install --upgrade tensorflow==1.7.0

Before you upgrade, be sure to check the release notes to ensure compatibility with your existing code and environment.

The Road Ahead for TensorFlow

With the 1.7 release, it‘s clear that TensorFlow continues to push the boundaries of what‘s possible with deep learning frameworks. Looking ahead, we can expect development to accelerate along several key fronts:

  • Eager execution becoming the default mode for TensorFlow models
  • Richer tools for model debugging, visualization, and deployment
  • More optimization integrations (e.g. TensorRT) for accelerating training and inference
  • Expanded support for deploying models on mobile and edge devices

As other frameworks like PyTorch gain adoption, it will be interesting to see how the TensorFlow team adapts and evolves its approach. Arguably the biggest challenge and opportunity for TensorFlow is to simplify the end-to-end workflow and continue lowering the barrier to entry for developers and researchers.

The 1.7 release is an exciting step in that direction, offering major improvements to model debugging and deployment while making the transition to eager execution more practical. We‘re looking forward to putting these new features through their paces.

What are your thoughts on TensorFlow 1.7? What do you think are the most important areas for the TensorFlow team to focus on going forward? Let us know in the comments!

Disclosure: Analytics Vidhya is an affiliate partner with the TensorFlow Dev Summit.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Similar Posts