The training workflow involves running a WandB sweep to find hyperparameters, followed by retrieving the best configuration.
1. Run WandB Sweep
Use the --sweep flag with the training script and a sweep configuration file:
python3 ./cellvit/train_cell_classifier_head.py --config /path/to/your/config.yaml --sweep
2. Find Best Hyperparameter Configuration
After the sweep, use the find_best_hyperparameter.py script to extract the best config from the sweep folder:
python3 ./script/find_best_hyperparameter.py /path/to/your/sweep --metric AUROC/Validation
3. Standard Training (No Sweep)
To run training directly with a specific configuration:
python3 ./cellvit/train_cell_classifier_head.py --config /path/to/your/config.yaml
# Example full workflow
mkdir logs_local
python3 ./cellvit/train_cell_classifier_head.py --config ./test_database/training_database/Example-Detection/train_configs/ViT256/fold_0_sweep.yaml --sweep
python3 ./scripts/find_best_hyperparameter.py /path/to/your/sweep --metric AUROC/Validation