add parser arg for hyp yaml file
Browse files
train.py
CHANGED
@@ -43,7 +43,9 @@ hyp = {'lr0': 0.01, # initial learning rate (SGD=1E-2, Adam=1E-3)
|
|
43 |
'translate': 0.0, # image translation (+/- fraction)
|
44 |
'scale': 0.5, # image scale (+/- gain)
|
45 |
'shear': 0.0} # image shear (+/- deg)
|
46 |
-
|
|
|
|
|
47 |
|
48 |
# Overwrite hyp with hyp*.txt (optional)
|
49 |
f = glob.glob('hyp*.txt')
|
@@ -382,10 +384,12 @@ if __name__ == '__main__':
|
|
382 |
parser.add_argument('--adam', action='store_true', help='use adam optimizer')
|
383 |
parser.add_argument('--multi-scale', action='store_true', help='vary img-size +/- 50%')
|
384 |
parser.add_argument('--single-cls', action='store_true', help='train as single-class dataset')
|
|
|
385 |
opt = parser.parse_args()
|
386 |
opt.weights = last if opt.resume else opt.weights
|
387 |
opt.cfg = check_file(opt.cfg) # check file
|
388 |
opt.data = check_file(opt.data) # check file
|
|
|
389 |
print(opt)
|
390 |
opt.img_size.extend([opt.img_size[-1]] * (2 - len(opt.img_size))) # extend to 2 sizes (train, test)
|
391 |
device = torch_utils.select_device(opt.device, apex=mixed_precision, batch_size=opt.batch_size)
|
|
|
43 |
'translate': 0.0, # image translation (+/- fraction)
|
44 |
'scale': 0.5, # image scale (+/- gain)
|
45 |
'shear': 0.0} # image shear (+/- deg)
|
46 |
+
|
47 |
+
# Don't need to be printing every time
|
48 |
+
#print(hyp)
|
49 |
|
50 |
# Overwrite hyp with hyp*.txt (optional)
|
51 |
f = glob.glob('hyp*.txt')
|
|
|
384 |
parser.add_argument('--adam', action='store_true', help='use adam optimizer')
|
385 |
parser.add_argument('--multi-scale', action='store_true', help='vary img-size +/- 50%')
|
386 |
parser.add_argument('--single-cls', action='store_true', help='train as single-class dataset')
|
387 |
+
parser.add_argument('--hyp', type=str, default='', help ='path to hyp yaml file')
|
388 |
opt = parser.parse_args()
|
389 |
opt.weights = last if opt.resume else opt.weights
|
390 |
opt.cfg = check_file(opt.cfg) # check file
|
391 |
opt.data = check_file(opt.data) # check file
|
392 |
+
opt.hyp = check_file(opt.hyp) #check file
|
393 |
print(opt)
|
394 |
opt.img_size.extend([opt.img_size[-1]] * (2 - len(opt.img_size))) # extend to 2 sizes (train, test)
|
395 |
device = torch_utils.select_device(opt.device, apex=mixed_precision, batch_size=opt.batch_size)
|