AI Development Environment Setup: Anaconda, Jupyter, and GPU Acceleration (Lecture 4)
In this lecture, we’ll set up a stable AI development environment for Machine Learning and Deep Learning projects. You’ll learn how to install Anaconda, run Jupyter Notebook, and configure GPU acceleration with CUDA and cuDNN.
Table of Contents
{% toc %}
1) Why Environment Setup Matters
A well-configured environment prevents common issues such as:
- Library version conflicts
- Slow training due to CPU-only execution
- Non-reproducible results across team members
Goals:
- Create isolated Python environments
- Install essential ML/DL libraries
- Enable GPU acceleration
- Set up a convenient coding workspace
2) Essential Tools Overview
2.1 Anaconda
- Manages Python versions and packages in isolated environments.
- Avoids dependency conflicts between projects.
2.2 Jupyter Notebook
- Interactive browser-based Python IDE.
- Perfect for experiments, data analysis, and sharing code.
2.3 GPU (CUDA + cuDNN)
- NVIDIA GPUs drastically speed up training.
- Requires correct CUDA Toolkit and cuDNN installation.
3) Installing Anaconda and Creating an Environment
Download Anaconda: https://www.anaconda.com/download
Create a new virtual environment:
1
conda create -n ai_env python=3.10
Activate the environment:
1
conda activate ai_env
Install essential packages:
1 2
conda install numpy pandas matplotlib scikit-learn pip install tensorflow torch
4) Installing and Running Jupyter Notebook
Install Jupyter:
1
conda install jupyter
Launch Jupyter:
1
jupyter notebook
Open the provided URL (e.g.,
http://localhost:8888
) in your browser.Create a new Python notebook and start coding.
5) Configuring GPU (NVIDIA Only)
5.1 Install CUDA Toolkit & cuDNN
- CUDA Toolkit: https://developer.nvidia.com/cuda-downloads
- cuDNN: https://developer.nvidia.com/cudnn
- After installation, add
CUDA_PATH
to your system environment variables.
5.2 Verify GPU Availability (TensorFlow Example)
|
|
Example Output
|
|
6) Lab: Environment Verification Script
Run the following in Jupyter Notebook to confirm your setup:
|
|
Expected Output
|
|
7) Key Takeaways
- Anaconda keeps Python environments isolated and conflict-free.
- Jupyter Notebook is ideal for ML/DL experiments.
- GPU acceleration significantly boosts training speed.
- Always verify your setup after installation.
8) What’s Next?
In Lecture 5, we’ll cover Data Preprocessing and Visualization—handling missing values, detecting outliers, normalizing data, and creating visualizations.