Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jianganghuang authored Jul 2, 2024
1 parent 21bd815 commit aba3984
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,24 @@ coco
```

## Training
Training configurations can be modified within the argument parser of “train.py” or “train_dual.py”.
Training configurations can be modified within the argument parser of “train.py” or “train_dual.py”.
The key factors are model, data, img, epoches, batch, device and training hyperparameters.
You can adjust the training hyperparameters in the `data/hyps/hyp.scratch-XXX.yaml` file. Here, `XXX` can be set to `low`, `med`, or `high`, which correspond to low, medium, and high levels of data augmentation, respectively.
```bash
python train.py --hyp hyp.scratch-low.yaml
hyp.scratch-med.yaml
hyp.scratch-high.yaml
```
The key factors are model, data, img, epoches, batch, device and training hyperparameters.
For instance, you can employ “yolov9-s-hyper.yaml” to train the “HyperYOLOv1.1-S” object detection model, and subsequently use “convert.py” along with “gelan-s-hyper.yaml” to remove the Auxiliary Reversible Branch.
# Single GPU training
### Single GPU training
```bash
# train yolov9-s-hyper models
python train_dual.py --workers 8 --device 0 --batch 16 --data data/coco.yaml --img 640 --cfg models/detect/yolov9-s-hyper.yaml --weights '' --name yolov9-s-hyper --hyp hyp.scratch-low.yaml --epochs 500

# train gelan-s-hyper models
# python train.py --workers 8 --device 0 --batch 32 --data data/coco.yaml --img 640 --cfg models/detect/gelan-s-hyper.yaml --weights '' --name gelan-s-hyper --hyp hyp.scratch-low.yaml --epochs 500
```
# Multiple GPU training
### Multiple GPU training
```bash
# train yolov9-s-hyper models
python -m torch.distributed.run --nproc_per_node 8 --master_port 9527 train_dual.py --workers 8 --device 0,1,2,3,4,5,6,7 --sync-bn --batch 128 --data data/coco.yaml --img 640 --cfg models/detect/yolov9-s-hyper.yaml --weights '' --name yolov9-s-hyper --hyp hyp.scratch-low.yaml --epochs 500
Expand Down

0 comments on commit aba3984

Please sign in to comment.