Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
What's New in TensorFlow 2.0

You're reading from   What's New in TensorFlow 2.0 Use the new and improved features of TensorFlow to enhance machine learning and deep learning

Arrow left icon
Product type Paperback
Published in Aug 2019
Publisher Packt
ISBN-13 9781838823856
Length 202 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (3):
Arrow left icon
Tanish Baranwal Tanish Baranwal
Author Profile Icon Tanish Baranwal
Tanish Baranwal
Alizishaan Khatri Alizishaan Khatri
Author Profile Icon Alizishaan Khatri
Alizishaan Khatri
Ajay Baranwal Ajay Baranwal
Author Profile Icon Ajay Baranwal
Ajay Baranwal
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Section 1: TensorFlow 2.0 - Architecture and API Changes
2. Getting Started with TensorFlow 2.0 FREE CHAPTER 3. Keras Default Integration and Eager Execution 4. Section 2: TensorFlow 2.0 - Data and Model Training Pipelines
5. Designing and Constructing Input Data Pipelines 6. Model Training and Use of TensorBoard 7. Section 3: TensorFlow 2.0 - Model Inference and Deployment and AIY
8. Model Inference Pipelines - Multi-platform Deployments 9. AIY Projects and TensorFlow Lite 10. Section 4: TensorFlow 2.0 - Migration, Summary
11. Migrating From TensorFlow 1.x to 2.0 12. Other Books You May Enjoy

Making code TF 2.0-native

The simplest way to make TF 1.x code compatible with TF 2.0 code is to run the update script that's installed on your system, along with the TF 2.0 installation. The update script makes use of the tf.compat.v1 module.

As a way to provide backward compatibility for code written for TF 1.x, the tf.compat.v1 module was introduced in TF 2.0. The tf.compat.v1 module replaces all TF 1.x symbols, such as tf.foo and tf.compat.v1.foo. This module allows most of the code that's been written for TF 1.x to be converted so that it can be run in TF 2.0.

As a way to streamline this process, TensorFlow provides a tf_upgrade_v2 utility, which helps streamline the transition as much as possible. This utility is preinstalled with the TF 2.0 installation, along with any TF 1.x installation from r1.13 and onwards. To run this script, simply specify an infile and...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime