SlimFace-demo / docs /test /training_test_doc.md
danhtran2mind's picture
Upload 164 files
b7f710c verified

A newer version of the Gradio SDK is available: 5.42.0

Upgrade

Running Training Scripts

Instructions to run these scripts in the tests folder on Linux, Windows, and macOS:

  • tests/training_accelerate_efficientnet_b3.sh
  • tests/training_accelerate_efficientnet_v2_s.sh
  • tests/training_accelerate_regnet_y_800mf.sh
  • tests/training_accelerate_vit_b_16_test.sh

Prerequisites

  1. Install Python, PyTorch, Accelerate:
    pip install requirements/requirements.txt
    
  2. Create virtual environment:
    python -m venv venv
    source venv/bin/activate  # Linux/macOS
    .\venv\Scripts\activate   # Windows
    
  3. Make scripts executable (Linux/macOS):
    chmod +x tests/*.sh
    

Linux

  1. Open terminal, go to folder:
    cd tests
    
  2. Run scripts:
    ./training_accelerate_efficientnet_b3.sh
    ./training_accelerate_efficientnet_v2_s.sh
    ./training_accelerate_regnet_y_800mf.sh
    ./training_accelerate_vit_b_16_test.sh
    
  3. Fix issues:
    • Use bash training_accelerate_efficientnet_b3.sh if ./ fails.
    • Fix line endings:
      sudo apt install dos2unix
      dos2unix training_accelerate_*.sh
      

Windows (using WSL)

  1. Install WSL and Ubuntu from Microsoft Store.
  2. Install dependencies:
    sudo apt update
    sudo apt install python3 python3-pip
    pip install -r requirements/requirements.txt
    
  3. Go to folder:
    cd ./tests
    
  4. Make executable:
    chmod +x training_accelerate_*.sh
    
  5. Run scripts:
    ./training_accelerate_efficientnet_b3.sh
    
  6. Fix issues:
    • Fix line endings:
      sudo apt install dos2unix
      dos2unix training_accelerate_*.sh
      

macOS

  1. Open Terminal, go to folder:
    cd tests
    
  2. Install dependencies:
    brew install python
    pip install -r requirements/requirements.txt
    
  3. Make executable:
    chmod +x training_accelerate_*.sh
    
  4. Run scripts:
    ./training_accelerate_efficientnet_b3.sh
    
  5. Fix issues:
    • Fix line endings:
      brew install dos2unix
      dos2unix training_accelerate_*.sh
      

Notes

  • Ensure GPU support (CUDA for Linux/Windows, MPS for macOS) if needed.
  • Check scripts for extra settings (e.g., export CUDA_VISIBLE_DEVICES=0).
  • Save output:
    ./training_accelerate_efficientnet_b3.sh > output.log 2>&1