Training and evaluation are performed using shell scripts and the train.py script.
Running training scripts
Execute the provided shell scripts for specific datasets, for example:
sh run_CVUSA.sh
Configuring train.py
- Dataset selection: Change the
--dataset flag to train on different datasets. - GPU configuration: Specify GPUs directly in
train.py. The code uses a multiprocessing distributed training style (similar to PyTorch and Moco) but defaults to using only one GPU. - Stage-1 training: To train the simple stage-1 model, remove the second line in the training script.
- Multi-GPU training: If using multiple GPUs, you may need to tune the learning rate (e.g., using the linear scaling rule). Note that using too many GPUs with the provided sampler may cause memory issues.
- Evaluation with pretrained weights: To evaluate using pretrained weights instead of training from scratch, add the
-e flag to train.py.
sh run_CVUSA.sh
# Or using train.py directly for evaluation:
python train.py -e --dataset <dataset_name>