From a85e6d0fc0036fe72b1a378ce35a5e7b70f29703 Mon Sep 17 00:00:00 2001 From: Alex Stoken Date: Tue, 16 Jun 2020 14:53:32 -0500 Subject: [PATCH] add parser arg for hyp yaml file --- train.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index 1e2d55a..0cf3d14 100644 --- a/train.py +++ b/train.py @@ -43,7 +43,9 @@ hyp = {'lr0': 0.01, # initial learning rate (SGD=1E-2, Adam=1E-3) 'translate': 0.0, # image translation (+/- fraction) 'scale': 0.5, # image scale (+/- gain) 'shear': 0.0} # image shear (+/- deg) -print(hyp) + +# Don't need to be printing every time +#print(hyp) # Overwrite hyp with hyp*.txt (optional) f = glob.glob('hyp*.txt') @@ -382,10 +384,12 @@ if __name__ == '__main__': parser.add_argument('--adam', action='store_true', help='use adam optimizer') parser.add_argument('--multi-scale', action='store_true', help='vary img-size +/- 50%') parser.add_argument('--single-cls', action='store_true', help='train as single-class dataset') + parser.add_argument('--hyp', type=str, default='', help ='path to hyp yaml file') opt = parser.parse_args() opt.weights = last if opt.resume else opt.weights opt.cfg = check_file(opt.cfg) # check file opt.data = check_file(opt.data) # check file + opt.hyp = check_file(opt.hyp) #check file print(opt) opt.img_size.extend([opt.img_size[-1]] * (2 - len(opt.img_size))) # extend to 2 sizes (train, test) device = torch_utils.select_device(opt.device, apex=mixed_precision, batch_size=opt.batch_size)