diff --git a/Jun30_21-37-32_todziedzic/events.out.tfevents.1593545853.todziedzic.4022.0 b/Jun30_21-37-32_todziedzic/events.out.tfevents.1593545853.todziedzic.4022.0 new file mode 100644 index 00000000..e69de29b diff --git a/our_scripts/config.yml b/our_scripts/config.yml index 584fb451..c6c5f246 100644 --- a/our_scripts/config.yml +++ b/our_scripts/config.yml @@ -1,21 +1,22 @@ train: - epochs: 600 - batch-size: 8 + epochs: 1200 + batch-size: 3 cfg: ./cfg/yolov3-spp-19cls.cfg data: ./data/widok_01_19.data multi-scale: false - img-size: '512 960' - rect: false - resume: true + img-size: '512 1920' + rect: true + resume: false nosave: false notest: false evolve: false bucket: cache-images: false - weights: /home/tomekb/yolov3/weights/last.pt + weights: /home/tomekb/yolov3/weights/yolov3-spp-ultralytics.pt device: 1 adam: true single-cls: false + save-every-nth-epoch: 50 # inne hiperparametry other-hyps: @@ -42,7 +43,7 @@ experiments: dir: ./experiments detect: source: /home/tomekb/yolov3/data/widok_01_19/widok_01_19_test_labels.txt - test-img-size: 1024 + test-img-size: 1920 conf-thres: 0.3 iou-thres: 0.6 classes: diff --git a/train.py b/train.py index 0a9f536a..fc967146 100644 --- a/train.py +++ b/train.py @@ -349,12 +349,15 @@ def train(hyp): 'model': ema.ema.module.state_dict() if hasattr(model, 'module') else ema.ema.state_dict(), 'optimizer': None if final_epoch else optimizer.state_dict()} + if epoch % opt.save_every_nth_epoch == 0: + torch.save(chkpt, f'yolo_{epoch}.pt') # Save last, best and delete torch.save(chkpt, last) if (best_fitness == fi) and not final_epoch: torch.save(chkpt, best) del chkpt + # end epoch ---------------------------------------------------------------------------------------------------- # end training @@ -397,9 +400,10 @@ if __name__ == '__main__': parser.add_argument('--device', default='', help='device id (i.e. 0 or 0,1 or cpu)') parser.add_argument('--adam', action='store_true', help='use adam optimizer') parser.add_argument('--single-cls', action='store_true', help='train as single-class dataset') + parser.add_argument('--save-every-nth-epoch', type=int, help='Saving every n-th epoth') opt = parser.parse_args() #opt.weights = last if opt.resume else opt.weights - check_git_status() + #check_git_status() opt.cfg = check_file(opt.cfg) # check file opt.data = check_file(opt.data) # check file #print(opt)