Updating Keras and TensorFlow to the latest versions can be a little tricky, but this guide will show you how to do it without any problems.
Check out this video:
Keras and TensorFlow are two of the most popular open-source libraries for Deep Learning. Though both are developed and maintained by Google, they are distinctively different frameworks designed for different purposes. While TensorFlow is a powerful framework for building custom models, Keras sits on top of TensorFlow and provides a high-level API that makes it easy to build, train, and deploy Deep Learning models.
If you’re already familiar with Deep Learning and you’re looking to get started with Keras and TensorFlow, this guide will show you how to update your libraries to the latest versions.
What’s new in Keras 2.3.0?
Keras 2.3.0 is now available! This release brings a number of new features, bug fixes, and improved performance.
Some of the highlights include:
– improved support for convolutional layers in the model setup API;
– better error messages when feeding data to models;
– a new “Debug” mode for TensorFlow (disabled by default);
– and much more!
For a full list of changes, please see the Keras 2.3.0 changelog.
What’s new in TensorFlow 2.3.0?
TensorFlow 2.3.0 is now available! This release brings a number of new features and improvements, including:
– Support for Nvidia Ampere GPUs
– A new experimental XLA compiler
– New operators and features for the TensorFlow Lite Converter
– Updates to the TensorFlow Model Optimization Toolkit
– And much more!
For a full list of changes and additions in this release, see the TensorFlow 2.3.0 release notes.
If you’re using a CPU-only version of TensorFlow, then you can update Keras using pip:
pip install – upgrade keras
If you’re using a GPU version of TensorFlow, then you can update Keras using pip, with oneimportant note. The current long-term support (LTS) version of Ubuntu Server is 16.04, which uses gcc 5.4.0 by default. Unfortunately, this compiler has a critical bug that prevents it from correctly compiling TensowFlow 1.4 or newer. As a result, if your Ubuntu Server is running 16.04, you’ll need to use an alternative compiler such as gcc 6 or 7 to successfully update Keras:
# Install GCC 6
sudo apt-get install build-essential software-properties-common -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update && sudo apt install gcc-6 g++-6 -y
# Install GCC 7
sudo apt install gcc g++ cmake libopenmpi* python python3 python3* zlib1g zlib1g* -y
import os os.environ[‘CC’] = ‘/usr/bin/gcc’ os.environ[‘CXX’] = ‘/usr/bin/g++’
# Verify correct compiler print(os.environ[‘CC’]) print(os.environ[‘CXX’])
# Update Keras pip install – upgrade keras“`
TensorFlow is an open source platform for machine learning. It offers many benefits over other platforms, including the ability to scale easily and automatic differentiation. TensorFlow also supports both CPU and GPU devices.
To update TensorFlow, simply follow the instructions on the TensorFlow website. You can either update your existing installation or install the new version from scratch. Be sure to back up your Keras models before updating, as the new version may not be compatible with older versions of Keras.
Using Keras with TensorFlow 2.3.0
As of TensorFlow 2.3.0, Keras is included as part of the core TensorFlow API. Keras provides a high-level, object-oriented API that makes it easy to construct and train deep learning models. In this tutorial, you will learn how to use Keras with TensorFlow 2.3.0 to train a simple deep learning model.
If you’re using Keras or TensorFlow in your machine learning projects, it’s important to keep both of these libraries up to date. Outdated versions of TensorFlow and/or Keras can cause errors and lead to sub-optimal results.
Fortunately, updating these libraries is relatively simple. In most cases, you can simply use pip to install the latest versions of TensorFlow and Keras. However, if you’re using a GPU for training your models, you’ll need to install the appropriate version of TensorFlow for your GPU.
Once you’ve installed the new versions of TensorFlow and Keras, be sure to restart your Python kernel so that the changes can take effect.
Keyword: How to Update Keras and TensorFlow