astoken commited on
Commit
ade023c
·
1 Parent(s): 3263a20

Fix hyp file read in and dict update.

Browse files
Files changed (2) hide show
  1. new_hyp.yaml +18 -0
  2. train.py +5 -1
new_hyp.yaml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ anchor_t: 10.0
2
+ cls: 0.58
3
+ cls_pw: 1.0
4
+ degrees: 20.0
5
+ fl_gamma: 1.0
6
+ giou: 0.15
7
+ hsv_h: 0.014
8
+ hsv_s: 0.68
9
+ hsv_v: 0.36
10
+ iou_t: 0.2
11
+ lr0: 0.001
12
+ momentum: 0.900
13
+ obj: 1.0
14
+ obj_pw: 1.0
15
+ scale: 0.5
16
+ shear: 0.0
17
+ translate: 0.0
18
+ weight_decay: 0.000625
train.py CHANGED
@@ -408,6 +408,7 @@ if __name__ == '__main__':
408
  opt.cfg = check_file(opt.cfg) # check file
409
  opt.data = check_file(opt.data) # check file
410
  opt.hyp = check_file(opt.hyp) if opt.hyp else '' #check file
 
411
  print(opt)
412
  opt.img_size.extend([opt.img_size[-1]] * (2 - len(opt.img_size))) # extend to 2 sizes (train, test)
413
  device = torch_utils.select_device(opt.device, apex=mixed_precision, batch_size=opt.batch_size)
@@ -419,7 +420,10 @@ if __name__ == '__main__':
419
  tb_writer = SummaryWriter(comment=opt.name)
420
 
421
  #updates hyp defaults from hyp.yaml
422
- if opt.hyp: hyp.update(opt.hyp)
 
 
 
423
 
424
  # Print focal loss if gamma > 0
425
  if hyp['fl_gamma']:
 
408
  opt.cfg = check_file(opt.cfg) # check file
409
  opt.data = check_file(opt.data) # check file
410
  opt.hyp = check_file(opt.hyp) if opt.hyp else '' #check file
411
+
412
  print(opt)
413
  opt.img_size.extend([opt.img_size[-1]] * (2 - len(opt.img_size))) # extend to 2 sizes (train, test)
414
  device = torch_utils.select_device(opt.device, apex=mixed_precision, batch_size=opt.batch_size)
 
420
  tb_writer = SummaryWriter(comment=opt.name)
421
 
422
  #updates hyp defaults from hyp.yaml
423
+ if opt.hyp:
424
+ with open(opt.hyp) as f:
425
+ updated_hyp = yaml.load(f, Loader=yaml.FullLoader)
426
+ hyp.update(updated_hyp)
427
 
428
  # Print focal loss if gamma > 0
429
  if hyp['fl_gamma']: