- Python 3.8 or higher
- pip package manager
- Virtual environment (recommended)
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Linux/Mac:
source venv/bin/activate
# On Windows:
venv\Scripts\activate# Navigate to project directory
cd Hackathon_1_final
# Install required packages
pip install -r requirements.txtFor development/editable installation:
pip install -e .For standard installation:
pip install .After installation, you can use the CLI command:
edge-compress --model model.pt --output compressed- numpy - Numerical operations
- torch - PyTorch deep learning framework
- tensorflow - TensorFlow deep learning framework
- onnx - ONNX model format
- onnxruntime - ONNX inference runtime
- tensorflow-model-optimization - TensorFlow compression tools
- torch-pruning - PyTorch pruning utilities
- tf2onnx - TensorFlow to ONNX conversion
For Hugging Face model support:
pip install transformers accelerateFor vision model support:
pip install timmFor ONNX optimization:
pip install onnx-simplifierFor development:
pip install pytest black flake8python test_framework.pyThis will run a series of tests to verify:
- All modules can be imported
- Engine can be initialized
- Configuration can be loaded
- Model analysis works
- Pipeline planning works
# Test import
from edge_compressor import CompressionEngine
# Initialize engine
engine = CompressionEngine()
print("✓ Installation successful!")Solution:
pip install torch torchvision torchaudioFor CPU-only PyTorch (smaller, faster install):
pip install torch --index-url https://download.pytorch.org/whl/cpuSolution:
pip install tensorflowFor CPU-only TensorFlow:
pip install tensorflow-cpuSolution: Make sure you're in the project directory:
cd Hackathon_1_final
export PYTHONPATH="${PYTHONPATH}:$(pwd)"Or install the package:
pip install -e .Solution: Create a fresh virtual environment:
# Deactivate current environment
deactivate
# Remove old environment
rm -rf venv
# Create new environment
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
# Install dependencies
pip install -r requirements.txtSolution: Install specific ONNX Runtime version:
pip install onnxruntime==1.12.0For GPU support:
pip install onnxruntime-gpuAll dependencies should install without issues. Make sure you have:
sudo apt-get update
sudo apt-get install python3-dev python3-pipFor M1/M2 Macs, use:
# Install TensorFlow for Apple Silicon
pip install tensorflow-macos tensorflow-metal
# Install PyTorch for Apple Silicon
pip install torch torchvision torchaudioMake sure you have Visual C++ redistributables installed for ONNX Runtime:
- Download from: https://aka.ms/vs/17/release/vc_redist.x64.exe
- Python 3.8+
- 4GB RAM
- 2GB free disk space
- Python 3.9+
- 8GB+ RAM
- 5GB+ free disk space
- GPU (optional, for faster compression)
For PyTorch with CUDA:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118For TensorFlow with CUDA:
pip install tensorflow[and-cuda]# PyTorch
import torch
print(f"CUDA available: {torch.cuda.is_available()}")
# TensorFlow
import tensorflow as tf
print(f"GPU devices: {tf.config.list_physical_devices('GPU')}")Create a Dockerfile:
FROM python:3.9
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY edge_compressor ./edge_compressor
COPY *.py ./
CMD ["python", "test_framework.py"]Build and run:
docker build -t edge-compressor .
docker run -v $(pwd)/models:/app/models edge-compressorAfter successful installation:
- Run tests:
python test_framework.py - Try examples:
python example_usage.py - Read quick start: See
QUICKSTART.md - Explore CLI:
python -m edge_compressor.cli --help
If you encounter issues not covered here:
- Check Python version:
python --version - Check pip version:
pip --version - List installed packages:
pip list - Check for conflicts:
pip check
Installation complete? Let's compress some models! 🚀