Welcome to the TensorFlow tutorial series! These interactive notebooks are designed to help colleagues learn the fundamentals of TensorFlow and deep learning through hands-on examples.
Run these notebooks directly in your browser - no setup required!
Learn the basics of TensorFlow and neural networks by building a simple model that learns linear relationships.
Topics covered:
- TensorFlow and Keras basics
- Building simple neural networks
- Training models with gradient descent
- Making predictions
- Visualizing model learning
Duration: ~30-45 minutes
Build a Convolutional Neural Network (CNN) to classify images of horses and humans.
Topics covered:
- Convolutional Neural Networks (CNNs)
- Image preprocessing and data generators
- Multi-layer CNN architectures
- Training on image datasets
- Model evaluation and visualization
- Understanding overfitting
Duration: ~1-1.5 hours
Just click the badges above! The notebooks will open directly in Google Colab where you can:
- Run all code interactively in your browser
- Get free GPU access for faster training
- No installation or setup required
- All data downloads automatically
- Changes are saved to your Google Drive
- Click the Code button at the top of this repository
- Select Codespaces → Create codespace on main
- Wait for the environment to load (~1-2 minutes)
- Install dependencies:
pip install -r requirements.txt - Run:
jupyter notebook - Open the notebooks and start coding!
If you prefer to run on your own machine:
# Clone this repository
git clone https://github.com/gsstephenson/tensorflow_tutorial.git
cd tensorflow_tutorial
# Create a virtual environment (optional but recommended)
python -m venv tf_env
source tf_env/bin/activate # On Windows: tf_env\Scripts\activate
# Install required packages
pip install -r requirements.txt
# Launch Jupyter Notebook
jupyter notebookThen navigate to the chapter folder and open the notebook.
tensorflow>= 2.xnumpymatplotlibjupyterorjupyterlab
- Minimum: Any modern CPU (training will be slower)
- Recommended: GPU-enabled machine or cloud service (Google Colab)
- Read the markdown cells carefully - They explain concepts and provide context
- Run code cells sequentially - Use Shift+Enter to execute each cell
- Experiment! - Modify parameters and see what happens
- Complete the exercises - Each notebook has hands-on challenges
- Don't skip visualizations - They help build intuition
- ✅ Don't rush - take time to understand each concept
- ✅ Run all code cells, even if you think you understand
- ✅ Try the exercises before looking at solutions
- ✅ Experiment with different parameters
- ✅ Ask questions when you're stuck
By the end of this tutorial series, colleagues will be able to:
- Understand the fundamentals of neural networks
- Build and train models using TensorFlow/Keras
- Work with different types of data (numerical and images)
- Understand and implement CNNs
- Evaluate model performance
- Debug common issues in deep learning
- Interpret training metrics and visualizations
tensorflow_tutorial/
├── README.md # This file
├── chapter_1/
│ ├── Chapter_1_Introduction_to_TensorFlow.ipynb
│ └── tf-sgd-test.py # Original script (for reference)
├── chapter_2/
│ ├── Chapter_2_Image_Classification_CNN.ipynb
│ └── h-or-h/
│ ├── h-or-h-cnn.py # Original script (for reference)
│ ├── tf-download-ch2.py # Original script (for reference)
│ └── horse-or-human/ # Dataset (auto-downloaded by notebook)
└── requirements.txt # Python dependencies (optional)
1. TensorFlow installation fails
# Try installing with specific version
pip install tensorflow==2.14.02. Out of memory errors
- Reduce batch size in the data generator
- Use smaller image sizes
- Close other applications
3. Slow training
- Use Google Colab with GPU enabled
- Reduce number of epochs for testing
- Use smaller datasets initially
4. Images not displaying
# Add this at the top of the notebook
%matplotlib inlineColleagues and collaborators are welcome to contribute improvements!
- Report issues or bugs
- Suggest new examples or exercises
- Improve documentation
- Add new chapters
This tutorial is provided for educational purposes. Feel free to use and modify for your courses.
- Pre-class: Have colleagues set up their environment
- In-class: Walk through notebooks together, pausing for discussions
- Lab time: Colleagues work on exercises with instructor support
- Homework: Additional experimentation and parameter tuning
- Assessment: Mini-project applying learned concepts
- Add your own datasets relevant to your field
- Create additional exercises specific to your curriculum
- Extend with more advanced topics (transfer learning, RNNs, etc.)
- Add quizzes or checkpoints within notebooks
If you encounter issues:
- Check the troubleshooting section above
- Review the error message carefully
- Search for the error online (Stack Overflow is helpful)
- Ask your instructor or teaching assistant
- Post in the TensorFlow forum with a clear description
Ready for more? Try these:
- Transfer Learning: Use pre-trained models (VGG16, ResNet)
- Multi-class Classification: Classify more than 2 categories
- Object Detection: Locate and classify objects in images
- Natural Language Processing: Apply deep learning to text
- Reinforcement Learning: Train agents to play games
Happy Learning! 🚀
Last Updated: November 2025