Skip to content

Commit 2692e67

Browse files
authored
Updated VOC hyperparameters (#6732)
* Update hyps * Update hyp.VOC.yaml * Update pathlib * Update hyps * Update hyps * Update hyps * Update hyps
1 parent a936f5f commit 2692e67

File tree

6 files changed

+45
-75
lines changed

6 files changed

+45
-75
lines changed

data/hyps/hyp.finetune_objects365.yaml renamed to data/hyps/hyp.Objects365.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
2+
# Hyperparameters for Objects365 training
3+
# python train.py --weights yolov5m.pt --data Objects365.yaml --evolve
4+
# See Hyperparameter Evolution tutorial for details https://github.com/ultralytics/yolov5#tutorials
25

36
lr0: 0.00258
47
lrf: 0.17

data/hyps/hyp.VOC.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
2+
# Hyperparameters for VOC training
3+
# python train.py --batch 128 --weights yolov5m6.pt --data VOC.yaml --epochs 50 --img 512 --hyp hyp.scratch-med.yaml --evolve
4+
# See Hyperparameter Evolution tutorial for details https://github.com/ultralytics/yolov5#tutorials
5+
6+
# YOLOv5 Hyperparameter Evolution Results
7+
# Best generation: 319
8+
# Last generation: 434
9+
# metrics/precision, metrics/recall, metrics/mAP_0.5, metrics/mAP_0.5:0.95, val/box_loss, val/obj_loss, val/cls_loss
10+
# 0.86236, 0.86184, 0.91274, 0.72647, 0.0077056, 0.0042449, 0.0013846
11+
12+
lr0: 0.0033
13+
lrf: 0.15184
14+
momentum: 0.74747
15+
weight_decay: 0.00025
16+
warmup_epochs: 3.4278
17+
warmup_momentum: 0.59032
18+
warmup_bias_lr: 0.18742
19+
box: 0.02
20+
cls: 0.21563
21+
cls_pw: 0.5
22+
obj: 0.50843
23+
obj_pw: 0.6729
24+
iou_t: 0.2
25+
anchor_t: 3.4172
26+
fl_gamma: 0.0
27+
hsv_h: 0.01032
28+
hsv_s: 0.5562
29+
hsv_v: 0.28255
30+
degrees: 0.0
31+
translate: 0.04575
32+
scale: 0.73711
33+
shear: 0.0
34+
perspective: 0.0
35+
flipud: 0.0
36+
fliplr: 0.5
37+
mosaic: 0.87158
38+
mixup: 0.04294
39+
copy_paste: 0.0
40+
anchors: 3.3556

data/hyps/hyp.finetune.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

data/hyps/hyp.scratch.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def parse_opt(known=False):
456456
parser.add_argument('--weights', type=str, default=ROOT / 'yolov5s.pt', help='initial weights path')
457457
parser.add_argument('--cfg', type=str, default='', help='model.yaml path')
458458
parser.add_argument('--data', type=str, default=ROOT / 'data/coco128.yaml', help='dataset.yaml path')
459-
parser.add_argument('--hyp', type=str, default=ROOT / 'data/hyps/hyp.scratch.yaml', help='hyperparameters path')
459+
parser.add_argument('--hyp', type=str, default=ROOT / 'data/hyps/hyp.scratch-low.yaml', help='hyperparameters path')
460460
parser.add_argument('--epochs', type=int, default=300)
461461
parser.add_argument('--batch-size', type=int, default=16, help='total batch size for all GPUs, -1 for autobatch')
462462
parser.add_argument('--imgsz', '--img', '--img-size', type=int, default=640, help='train, val image size (pixels)')

utils/general.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ def print_mutation(results, hyp, save_dir, bucket, prefix=colorstr('evolve: ')):
795795
# Download (optional)
796796
if bucket:
797797
url = f'gs://{bucket}/evolve.csv'
798-
if gsutil_getsize(url) > (os.path.getsize(evolve_csv) if os.path.exists(evolve_csv) else 0):
798+
if gsutil_getsize(url) > (evolve_csv.stat().st_size if evolve_csv.exists() else 0):
799799
os.system(f'gsutil cp {url} {save_dir}') # download evolve.csv if larger than local
800800

801801
# Log to evolve.csv

0 commit comments

Comments
 (0)