TensorFlow vs Keras: What Are They?

Deep Learning with Keras and TensorFlow 8 min min read Updated: Nov 16, 2026 Beginner
TensorFlow vs Keras: What Are They?
Beginner Topic 3 of 7

What is TensorFlow?

TensorFlow is an open-source library created by Google for numerical computing and machine learning. It does the heavy math, runs on CPU, GPU and TPU, and has tools to deploy models to servers, phones and browsers.

What is Keras?

Keras is a high-level deep learning library. It gives you simple building blocks such as layers, models, optimizers and losses so that you can create neural networks with very little code.

Easy way to remember: TensorFlow is the engine. Keras is the steering wheel and pedals that make the car easy to drive.

How Are They Connected?

For many years, Keras was bundled inside TensorFlow as tf.keras. Starting with TensorFlow 2.16, TensorFlow uses Keras 3 by default. Keras 3 is a multi-backend library, which means the same Keras code can run on top of TensorFlow, JAX or PyTorch.

BackendNotes
TensorFlowDefault and best for deployment tools (TFLite, TF Serving)
JAXVery fast on GPUs and TPUs
PyTorchUse Keras models inside the PyTorch world

How to Import

python # Recommended in this course (Keras 3) import keras from keras import layers # This also works when TensorFlow is installed from tensorflow import keras

In this course we mostly write import keras. When we need TensorFlow-specific tools, such as tf.data or tf.GradientTape, we also write import tensorflow as tf.

Check Your Versions

python import keras import tensorflow as tf print("Keras version:", keras.__version__) print("TensorFlow version:", tf.__version__) print("Backend:", keras.backend.backend())
Result

Keras version 3.x, TensorFlow version 2.16 or newer, Backend: tensorflow

TensorFlow or PyTorch?

Both are excellent. TensorFlow and Keras are famous for being beginner-friendly and having strong deployment tools. PyTorch is popular in research. With Keras 3, you can even switch the backend later, so what you learn here stays useful.

Conclusion

You will write most of your code with Keras and let TensorFlow work in the background. Keras 3 also gives you the freedom to choose another backend in the future.

Quick Summary: Keras is the easy interface, TensorFlow is the engine. Keras 3 supports TensorFlow, JAX and PyTorch.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators