tensorflow
by tensorflow
Google's open-source machine learning framework for building and training neural networks.
- Stars
- 201,770 stars
- Forks
- 77k forks
- Last push
- today
- Activity
- Active
# Install TensorFlow (GPU support on Ubuntu and Windows)$ pip install tensorflow# Or the smaller CPU-only package$ pip install tensorflow-cpuCommands from the project's README. Run them after installing (see below).
Overview
Understand tensorflow in 60 seconds
- What it does
- TensorFlow is Google's open-source platform for building, training and deploying machine learning models. It provides Python and C++ APIs plus a large ecosystem of tools and libraries.
- The problem it solves
- Building machine learning models from scratch means writing the maths for tensors, gradients and hardware acceleration yourself. TensorFlow provides those building blocks and runs them on CPUs and GPUs.
- Why choose it
- Choose it if you want a mature framework with a big ecosystem for training and deploying models, especially if your team already uses it. Many newer research projects use PyTorch, so check what the models you need are written in.
- Who should use it
- Machine learning researchers
- Developers adding ML features to applications
- Students learning deep learning
- Teams deploying models to production, mobile or the web
- Setup difficulty
You'll need:
- Python with pip
- Optional: a CUDA-enabled NVIDIA GPU on Ubuntu or Windows
- Other devices (DirectX, macOS Metal) through device plugins
How tensorflow works
TensorFlow was created by researchers and engineers on the Google Brain team for machine learning and neural network research, and is general enough for many other uses. It offers stable Python and C++ APIs, with other language bindings that are not guaranteed to stay backward compatible.
The standard pip package includes support for CUDA-enabled GPUs on Ubuntu and Windows, and a smaller CPU-only package is available. DirectX and macOS Metal devices are supported through device plugins, and Docker images and source builds are documented on tensorflow.org.
Nightly builds are published as tf-nightly for testing. The tensorflow.org tutorials are the main place to learn it, and release and security announcements go out on the announce mailing list.
Features
Key features
End-to-end ML platform
Build, train and deploy models with one framework.
Python and C++ APIs
Stable APIs for both languages.
GPU acceleration
CUDA GPU support included in the standard package.
Device plugins
Run on DirectX and macOS Metal devices.
Large ecosystem
Tools, libraries and community resources around the core.
Docker and source builds
Official containers and build-from-source guides.
Strengths
- Mature and widely used, backed by Google
- Large ecosystem and documentation
- Runs on CPUs, GPUs and other devices
- Apache-2.0 license
Limitations
- Big install compared with lighter libraries
- GPU setup can take some work
- APIs for languages other than Python and C++ may change
Practical use cases
Train an image classifier
Follow the tensorflow.org tutorials to train a model on your own images.
Add ML to an app
Train a model in Python and deploy it with the TensorFlow ecosystem.
Learn deep learning
Use it with the official tutorials to learn the basics.
Installation
Install tensorflow
Commands come from TensorFlow's README. AIRepoHub hasn't run them yet. View source
Prerequisites
- Python and pip
Supported systems
- Windows
- macOS
- Linux
- 1
Install the current release
Includes CUDA GPU support on Ubuntu and Windows.
Shellpip install tensorflow - 2
Upgrade later
Shellpip install --upgrade tensorflow
- 1
Install the smaller CPU-only package
Shellpip install tensorflow-cpu
Configuration and API keys
| Setting | What it's for |
|---|
First run
- 1
Start Python
Shellpython - 2
Run a first operation
Textimport tensorflow as tftf.add(1, 2).numpy()
tensorflow's documentation doesn't include sample output, so we don't show any. Expect the results in your terminal.
Your first project
Run your first TensorFlow program
Check that TensorFlow works by running a couple of operations in Python.
Before you start
- TensorFlow installed with pip
- 1
Start Python
Shellpython - 2
Add two numbers
Textimport tensorflow as tftf.add(1, 2).numpy() - 3
Make a string tensor
Texthello = tf.constant('Hello, TensorFlow!')hello.numpy()
What to expect
The first call returns 3 and the second returns b'Hello, TensorFlow!'.
Next steps
- Work through the TensorFlow tutorials on tensorflow.org
- Set up GPU support from the install guide
- Try a Docker container for a reproducible setup
Costs and requirements
What it costs to run
- License
- Apache-2.0. Free to use, modify and use commercially.Free
- Software
- Free and open source.Free
- Hardware
- Training large models may need GPUs, which cost money if rented.Depends
Troubleshooting
Common setup issues
GPU isn't used
GPU support in the pip package covers CUDA-enabled cards on Ubuntu and Windows. See the GPU install guide on tensorflow.org.
Running on a Mac GPU or DirectX
Use the device plugins described in the install guide.
Want the newest fixes
Try the tf-nightly package for testing.
Alternatives
Similar AI repositories
opencv
opencv
Widely used open-source library for computer vision and image processing.
tesseract
tesseract-ocr
Open-source OCR engine that recognizes text in images and scanned documents.
superpowers
obra
Collection of agent skills and a working method that guide AI coding agents through software development step by step.
andrej-karpathy-skills
multica-ai
A single CLAUDE.md file of coding rules, based on Andrej Karpathy's notes, that makes Claude Code ask before assuming, keep code simple and change only what you asked.