Reach 80%+ validation accuracy in 15 epochs (3 phases Γ 5 epochs each)
Starting from: Epoch 15 (Current: 53.2% val acc)
aggressive_utils.py- Mixup, EMA, TTA utilitiesresume_aggressive.py- Main aggressive training scriptEXECUTION_GUIDE.md- This file
β Iterative LR Finder - Discovers optimal LR for each phase β Mixup Augmentation - Boosts accuracy by 5-7% β EMA (Exponential Moving Average) - Stabilizes training β Test-Time Augmentation (TTA) - +2-3% accuracy at inference β OneCycleLR per phase - Fast convergence β 5-epoch phases - Rapid iteration (as requested)
ls -lh checkpoints_1000class/checkpoint_epoch_15.pthExpected output: File should exist with size ~100MB
If training is still running, stop it:
# Press Ctrl+C in the training terminal
# Or kill the process:
pkill -f main_1000classes.pycd /Users/prateekgarg/Documents/ERAV4/Session_9/Assignment/test_100_classes_process/ERAV4_Session9
python resume_aggressive.pyThat's it! The script will automatically:
- Load checkpoint from epoch 15
- Run 3 phases of 5 epochs each
- Find optimal LR at the start of each phase
- Apply Mixup, EMA, and TTA
- Save best checkpoints for each phase
- LR Finder runs for ~5 minutes
- Training ~37 minutes (5 epochs Γ ~7.4 min/epoch)
- Expected: 65-70% validation accuracy
- Checkpoint:
checkpoints_aggressive/phase1_best_acc*.pth
- LR Finder runs for ~5 minutes
- Training ~37 minutes
- Expected: 74-77% validation accuracy
- Checkpoint:
checkpoints_aggressive/phase2_best_acc*.pth
- LR Finder runs for ~3 minutes (fewer iterations)
- Training ~37 minutes
- Expected: 79-82% validation accuracy β TARGET
- Checkpoint:
checkpoints_aggressive/phase3_best_acc*.pth
phase1_latest.pth # Latest from phase 1
phase1_best_acc67.45.pth # Best from phase 1 (example)
phase2_latest.pth # Latest from phase 2
phase2_best_acc75.23.pth # Best from phase 2 (example)
phase3_latest.pth # Latest from phase 3
phase3_best_acc80.56.pth # Best from phase 3 (example) β TARGET!
aggressive_20251024_120530.log # Complete training log
# In a separate terminal
tail -f logs_aggressive/aggressive_*.loggrep "Val: Loss" logs_aggressive/aggressive_*.log | tail -20grep "Phase.*Complete" logs_aggressive/aggressive_*.log- LR Strategy: Start at current LR (0.06368) Γ 1.5 = 0.095
- Mixup: Strong (Ξ±=0.4) for better generalization
- EMA: Enabled for stability
- TTA: Disabled (faster validation)
- Goal: Jump from 53% β 68%
- LR Strategy: Re-run LR finder for optimal LR
- Mixup: Moderate (Ξ±=0.3)
- EMA: Enabled
- TTA: Enabled (+2-3% boost)
- Goal: Reach 74-77%
- LR Strategy: Re-run LR finder with lower range
- Mixup: Light (Ξ±=0.2)
- EMA: Enabled
- TTA: Enabled
- Goal: Final push to 80%+
The script will fallback to default LR (0.1). Check logs for:
β οΈ WARNING: LR Finder failed, using default LR
- Check if LR is too high in logs
- Script has safety: max_lr is reduced by 20% automatically
- If still diverging, edit
resume_aggressive.pyline 100:max_lr_adjusted = max_lr * 0.6 # Change from 0.8 to 0.6
Reduce batch size in the script (not likely with 256 on A10G)
Check data directory path:
ls ./imagenet_1000class_data/After Phase 1 (Epoch 20):
Val Acc: 67-70%
Val Loss: ~2.5-2.7
Top-5 Acc: ~85-87%
After Phase 2 (Epoch 25):
Val Acc: 75-77%
Val Loss: ~1.8-2.0
Top-5 Acc: ~90-92%
After Phase 3 (Epoch 30):
Val Acc: 80-82% β TARGET
Val Loss: ~1.5-1.7
Top-5 Acc: ~93-95%
If training is interrupted, you can resume:
Edit resume_aggressive.py and modify the run_all_phases call:
# To resume from Phase 2 (epoch 21):
trainer.run_all_phases(start_epoch=21)
# And comment out Phase 1 in the phases list (lines 30-38)Or load the latest checkpoint:
checkpoint_path = './checkpoints_aggressive/phase1_latest.pth'
checkpoint = torch.load(checkpoint_path)
model.load_state_dict(checkpoint['model_state_dict'])
start_epoch = checkpoint['epoch'] + 1- Don't interrupt during LR Finder - Let it complete (~3-5 min)
- Monitor first few batches - Ensure loss is decreasing
- Check GPU utilization:
nvidia-smishould show ~90%+ usage - Compare with baseline: Your current 53% should jump quickly in Phase 1
- Iterative LR Finding: Optimal LR for current model state
- Aggressive LR schedules: OneCycleLR peaks quickly
- Mixup augmentation: Better generalization = faster convergence
- EMA weights: Smoother optimization path
- TTA at validation: Free accuracy boost
- Short phases: 5 epochs each = rapid iteration
Minimum Acceptable:
- Phase 1: 65%+ val acc
- Phase 2: 72%+ val acc
- Phase 3: 78%+ val acc
Target:
- Phase 3: 80%+ val acc π―
Stretch Goal:
- Phase 3: 82%+ val acc π
# Start training
python resume_aggressive.py
# Monitor logs
tail -f logs_aggressive/aggressive_*.log
# Check GPU
nvidia-smi
# Kill training
pkill -f resume_aggressive.py
# Check latest accuracy
grep "Val:.*Acc" logs_aggressive/aggressive_*.log | tail -1Your best model will be saved as:
checkpoints_aggressive/phase3_best_acc80.XX.pth
Load it for inference:
checkpoint = torch.load('checkpoints_aggressive/phase3_best_acc80.XX.pth')
model.load_state_dict(checkpoint['model_state_dict'])Good luck! π