How to import TensorFlow in Python

In this article, you’ll see how to import TensorFlow into Python. If TensorFlow is not installed, then first install it using this code.

pip install tensorflow

Import TensorFlow

In the given code, tf is only an alias for TensorFlow. You can also import it without an alias.

import tensorflow as tf

I recommend you get this book, “Deep Learning with TensorFlow 2 and Keras”.

Leave a Comment

Your email address will not be published.