Remove --resume functionality and related checks/logic.
Browse files- equip_hyp.yaml +18 -0
- train.py +1 -21
equip_hyp.yaml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
anchor_t: 4.0
|
2 |
+
cls: 0.58
|
3 |
+
cls_pw: 1.0
|
4 |
+
degrees: 0.0
|
5 |
+
fl_gamma: 0.0
|
6 |
+
giou: 0.05
|
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.90
|
13 |
+
obj: 1.0
|
14 |
+
obj_pw: 1.0
|
15 |
+
scale: 0.5
|
16 |
+
shear: 5
|
17 |
+
translate: 0.05
|
18 |
+
weight_decay: 0.0005
|
train.py
CHANGED
@@ -372,8 +372,6 @@ if __name__ == '__main__':
|
|
372 |
parser.add_argument('--data', type=str, default='data/coco128.yaml', help='*.data path')
|
373 |
parser.add_argument('--img-size', nargs='+', type=int, default=[640, 640], help='train,test sizes. Assumes square imgs.')
|
374 |
parser.add_argument('--rect', action='store_true', help='rectangular training')
|
375 |
-
parser.add_argument('--resume', action='store_true', help='resume training from last.pt')
|
376 |
-
parser.add_argument('--resume-from-run', type=str, default='', help='resume training from last.pt in this dir')
|
377 |
parser.add_argument('--nosave', action='store_true', help='only save final checkpoint')
|
378 |
parser.add_argument('--notest', action='store_true', help='only test final epoch')
|
379 |
parser.add_argument('--evolve', action='store_true', help='evolve hyperparameters')
|
@@ -385,27 +383,9 @@ if __name__ == '__main__':
|
|
385 |
parser.add_argument('--adam', action='store_true', help='use adam optimizer')
|
386 |
parser.add_argument('--multi-scale', action='store_true', help='vary img-size +/- 50%')
|
387 |
parser.add_argument('--single-cls', action='store_true', help='train as single-class dataset')
|
388 |
-
parser.add_argument('--hyp', type=str, default='', help ='path to hyp yaml file.
|
389 |
opt = parser.parse_args()
|
390 |
|
391 |
-
# logic to resume from latest run if either --resume or --resume-from-run is selected
|
392 |
-
# Note if neither --resume or --resume-from-run, last is set to empty string
|
393 |
-
if opt.resume_from_run:
|
394 |
-
opt.resume = True
|
395 |
-
last = opt.resume_from_run
|
396 |
-
elif opt.resume and not opt.resume_from_run:
|
397 |
-
last = get_latest_run()
|
398 |
-
print(f'WARNING: No run provided to resume from. Resuming from most recent run found at {last}')
|
399 |
-
else:
|
400 |
-
last = ''
|
401 |
-
|
402 |
-
# if resuming, check for hyp file
|
403 |
-
if last:
|
404 |
-
last_hyp = last.replace('last.pt', 'hyp.yaml')
|
405 |
-
if os.path.exists(last_hyp):
|
406 |
-
opt.hyp = last_hyp
|
407 |
-
|
408 |
-
opt.weights = last if opt.resume else opt.weights
|
409 |
opt.cfg = check_file(opt.cfg) # check file
|
410 |
opt.data = check_file(opt.data) # check file
|
411 |
opt.hyp = check_file(opt.hyp) if opt.hyp else '' #check file
|
|
|
372 |
parser.add_argument('--data', type=str, default='data/coco128.yaml', help='*.data path')
|
373 |
parser.add_argument('--img-size', nargs='+', type=int, default=[640, 640], help='train,test sizes. Assumes square imgs.')
|
374 |
parser.add_argument('--rect', action='store_true', help='rectangular training')
|
|
|
|
|
375 |
parser.add_argument('--nosave', action='store_true', help='only save final checkpoint')
|
376 |
parser.add_argument('--notest', action='store_true', help='only test final epoch')
|
377 |
parser.add_argument('--evolve', action='store_true', help='evolve hyperparameters')
|
|
|
383 |
parser.add_argument('--adam', action='store_true', help='use adam optimizer')
|
384 |
parser.add_argument('--multi-scale', action='store_true', help='vary img-size +/- 50%')
|
385 |
parser.add_argument('--single-cls', action='store_true', help='train as single-class dataset')
|
386 |
+
parser.add_argument('--hyp', type=str, default='', help ='path to hyp yaml file.')
|
387 |
opt = parser.parse_args()
|
388 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
opt.cfg = check_file(opt.cfg) # check file
|
390 |
opt.data = check_file(opt.data) # check file
|
391 |
opt.hyp = check_file(opt.hyp) if opt.hyp else '' #check file
|