TensorFlow 2.0 was released recently with tighter integration with Keras, eager execution enabled by default, three times faster training performance, a cleaned-up API, and more.
TensorFlow 2.0 had a major API Cleanup. Many API symbols are removed or renamed for better consistency and clarity. It now enables eager execution by default which effectively means that your TensorFlow code runs like numpy code. Keras has been introduced as the main high-level API to enable developers to easily leverage Keras’ various model-building APIs. TensorFlow 2.0 also has the SavedModel API that allows you to save your trained Machine learning model into a language-neutral format.
In May, Paige Bailey, Product Manager (TensorFlow) and Laurence Moroney, Developer Advocate at Google sat down to discuss frequently asked questions on TensorFlow 2.0. They talked about TensorFlow prebuilt binaries, the TF 2.0 upgrade script, Tensorflow Datasets, and Python support.
Can I ask about any prebuilt binary for the RTX 2080 GPU on Ubuntu 16?
Prebuilt binaries for TensorFlow tend to be associated with a specific driver from Nvidia. If you’re taking a look at any of the prebuilt binaries, take a look at what driver or what version of the driver you have supported on that specific card. It’s easy for you to go to the driver vendor and download the latest version. But that may not be the one that TensorFlow is built for or the one that it supports. So, just make sure that they actually match each other.
Do my TensorFlow scripts work with TensorFlow 2.0?
Generally, TensorFlow scripts do not work with TensorFlow 2.0. But TensorFlow 2.0 has created an upgrade utility that is automatically downloaded with TensorFlow 2.0. For more information, you can check out this medium blog post that Paige and her colleague Anna created. It shows how you can upgrade script on an end file – any arbitrary Python file or even Jupyter Notebooks. It’ll give you an export.txt file that shows you all of the symbol renames, the added keywords, and then some manual changes.
When will TensorFlow be supported in Python 3.7 and hence be accessed in Anaconda 3?
TensorFlow has made the commitment that as of January 1, 2020, they no longer support Python 2. They are firmly committed to Python 3 and Python 3 support.
Is it possible to run Tensorboard on colabs?
You can run Tensorboard on colabs and do different operations like smoothing, changing some of the values, and using the embedding visualizer directly from your collab notebook in order to understand accuracies and to be able to model performance debugging. You also don’t have to specify ports which means you need not remember to have multiple tensor board instances running. Tensorboard automatically selects one that would be a good candidate.
How would you use [TensorFlow’s] feature_columns with Keras?
TensorFlow’s feature_columns API is quite useful for non-numerical feature processing. Feature columns are a way of getting your data efficiently into Estimators and you can use them in Keras. TensorFlow 2.0 also has a migration guide if you wanted to migrate your models from using Estimators to being more of a TensorFlow 2.0 format with Keras.
What are some simple data sets for testing and comparing different training methods for artificial neural networks? Are there any in TensorFlow 2.0?
Although MNIST and Fashion-MNIST are great, TensorFlow 2.0 also has TensorFlow Datasets which provide a collection of datasets ready to use with TensorFlow. It handles downloading and preparing the data and constructing a tf.data. TensorFlow Datasets is compatible with both TensorFlow Eager mode and Graph mode. Also, you can use them with all of your deep learning and machine learning models with just a few lines of code.
What about all the web developers who are new to AI, how does TensorFlow 2.0 help them get started?
With TensorFlow 2.0, the web models that you create using saved model can be deployed to TFLite, or TensorFlow.js. The Keras layers are also supported in TensorFlow.js, so it’s not just for Python developers but also for JS developers or even R developers.
You can watch Paige and Lawrence answering more questions in this three-part video series available on YouTube. Some of the other questions asked were:
- Is there any TensorFlow.js transfer learning example for object detection?
- Are you going to publish the updated version of TensorFlow from Poets tutorial from Pete Warden implementing TF2.0. TFLite 2.0 and NN-API for faster inference on Android devices equipped with NPU/DSP?
- Will the frozen graph generated from TF 1.x work on TF 2.0?
- Which is the preferred format for saving the model GOIU forward saved_model (SM) or hd5?
- What is the purpose of keeping Estimators and Keras as separate APIs?
If you want to quickly start with building machine learning projects with TensorFlow 2.0, read our book TensorFlow 2.0 Quick Start Guide by Tony Holdroyd. In this book, you will get acquainted with some new practices introduced in TensorFlow 2.0. You will also learn to train your own models for effective prediction, using high-level Keras API.
Read Next
Brad Miro talks TensorFlow 2.0 features and how Google is using it internally