调试
This commit is contained in:
parent
ee5d09adfe
commit
dcc9e75ef1
@ -467,18 +467,14 @@ def train(hyp, opt, device, data_list,id,callbacks): # hyp is path/to/hyp.yaml
|
|||||||
# end training -----------------------------------------------------------------------------------------------------
|
# end training -----------------------------------------------------------------------------------------------------
|
||||||
if RANK in {-1, 0}:
|
if RANK in {-1, 0}:
|
||||||
LOGGER.info(f'\n{epoch - start_epoch + 1} epochs completed in {(time.time() - t0) / 3600:.3f} hours.')
|
LOGGER.info(f'\n{epoch - start_epoch + 1} epochs completed in {(time.time() - t0) / 3600:.3f} hours.')
|
||||||
print('##############',best)
|
|
||||||
for f in best:
|
|
||||||
print('##################',f)
|
|
||||||
if os.path.exists(best):
|
if os.path.exists(best):
|
||||||
strip_optimizer(f) # strip optimizers
|
strip_optimizer(best) # strip optimizers
|
||||||
if f is best:
|
|
||||||
LOGGER.info(f'\nValidating {f}...')
|
LOGGER.info(f'\nValidating {f}...')
|
||||||
results, _, _ = validate.run(
|
results, _, _ = validate.run(
|
||||||
data_dict,
|
data_dict,
|
||||||
batch_size=batch_size // WORLD_SIZE * 2,
|
batch_size=batch_size // WORLD_SIZE * 2,
|
||||||
imgsz=imgsz,
|
imgsz=imgsz,
|
||||||
model=attempt_load(f, device).half(),
|
model=attempt_load(best, device).half(),
|
||||||
iou_thres=0.65 if is_coco else 0.60, # best pycocotools at iou 0.65
|
iou_thres=0.65 if is_coco else 0.60, # best pycocotools at iou 0.65
|
||||||
single_cls=single_cls,
|
single_cls=single_cls,
|
||||||
dataloader=val_loader,
|
dataloader=val_loader,
|
||||||
@ -490,7 +486,6 @@ def train(hyp, opt, device, data_list,id,callbacks): # hyp is path/to/hyp.yaml
|
|||||||
compute_loss=compute_loss) # val best model with plots
|
compute_loss=compute_loss) # val best model with plots
|
||||||
if is_coco:
|
if is_coco:
|
||||||
callbacks.run('on_fit_epoch_end', list(mloss) + list(results) + lr, epoch, best_fitness, fi)
|
callbacks.run('on_fit_epoch_end', list(mloss) + list(results) + lr, epoch, best_fitness, fi)
|
||||||
|
|
||||||
#callbacks.run('on_train_end', best, epoch, results)
|
#callbacks.run('on_train_end', best, epoch, results)
|
||||||
|
|
||||||
torch.cuda.empty_cache()
|
torch.cuda.empty_cache()
|
||||||
|
Loading…
Reference in New Issue
Block a user