diff --git a/train.py b/train.py index cc5d34f3..b0a5ec86 100644 --- a/train.py +++ b/train.py @@ -227,7 +227,7 @@ def train( # Calculate mAP (always test final epoch, skip first 5 if opt.nosave) if not (opt.notest or (opt.nosave and epoch < 10)) or epoch == epochs - 1: with torch.no_grad(): - results, maps = test.test(cfg, data_cfg, batch_size=batch_size*2, img_size=img_size_test, model=model, + results, maps = test.test(cfg, data_cfg, batch_size=batch_size * 2, img_size=img_size_test, model=model, conf_thres=0.1) # Write epoch results diff --git a/utils/gcp.sh b/utils/gcp.sh index 469b8ed0..7f985c8f 100755 --- a/utils/gcp.sh +++ b/utils/gcp.sh @@ -93,10 +93,8 @@ python3 test.py --data ../supermarket2/supermarket2.data --weights ../darknet/ba - - # Debug/Development -python3 train.py --data data/coco.data --img-size 320 --single-scale --batch-size 64 --accumulate 1 --epochs 1 --evolve +python3 train.py --data data/coco.data --img-size 320 --single-scale --batch-size 64 --accumulate 1 --epochs 1 --evolve --giou python3 test.py --weights weights/latest.pt --cfg cfg/yolov3-spp.cfg --img-size 320 gsutil cp evolve.txt gs://ultralytics diff --git a/utils/utils.py b/utils/utils.py index 4dfe6b5b..8b9640ce 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -291,7 +291,7 @@ def compute_loss(p, targets, model, giou_loss=False): # predictions, targets, m # Compute losses if len(b): # number of targets pi = pi0[b, a, gj, gi] # predictions closest to anchors - tconf[b, a, gj, gi] = 1 # conf + tconf[b, a, gj, gi] = 1.0 # conf # pi[..., 2:4] = torch.sigmoid(pi[..., 2:4]) # wh power loss (uncomment) if giou_loss: