From e8303a366fa62ddc57f4e28b1f9323a59508bb99 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 30 Jul 2019 18:24:20 +0200 Subject: [PATCH] updates --- train.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index ae68dca2..8f624b1f 100644 --- a/train.py +++ b/train.py @@ -198,7 +198,8 @@ def train(cfg, # Start training model.hyp = hyp # attach hyperparameters to model - # model.class_weights = labels_to_class_weights(dataset.labels, nc).to(device) # attach class weights + if dataset.image_weights: + model.class_weights = labels_to_class_weights(dataset.labels, nc).to(device) # attach class weights model_info(model, report='summary') # 'full' or 'summary' nb = len(dataloader) maps = np.zeros(nc) # mAP per class