Transfer learning using pytorch GPU acceleration on the ResNet50 model to train on the Food101 dataset
Documentation in ipynb file.
-
Create a virtualenv and install deps: python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt
-
Train (downloads Food-101 automatically to ./data): python scripts/train.py --config configs/default.yaml
-
Evaluate a checkpoint: python scripts/eval.py --config configs/default.yaml --checkpoint models/checkpoints/your-file.pth
-
Predict on an image: python scripts/predict.py --config configs/default.yaml --checkpoint models/checkpoints/your-file.pth --image path/to/image.jpg
Notes:
- Device is auto-detected; force with device: cpu or device: cuda in config.
- Number of classes is inferred from the dataset.
- Checkpoints include model/optimizer state and epoch.