Skip to content

Commit

Permalink
verbose on final_epoch (ultralytics#1997)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Jan 21, 2021
1 parent 89aac04 commit 58149a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def test(data,
plots=True,
log_imgs=0, # number of logged images
compute_loss=None):

# Initialize/load model and set device
training = model is not None
if training: # called by train.py
Expand Down Expand Up @@ -227,7 +226,7 @@ def test(data,
print(pf % ('all', seen, nt.sum(), mp, mr, map50, map))

# Print results per class
if (verbose or (nc <= 20 and not training)) and nc > 1 and len(stats):
if (verbose or (nc < 50 and not training)) and nc > 1 and len(stats):
for i, c in enumerate(ap_class):
print(pf % (names[c], seen, nt[c], p[i], r[i], ap50[i], ap[i]))

Expand Down
1 change: 1 addition & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def train(hyp, opt, device, tb_writer=None, wandb=None):
single_cls=opt.single_cls,
dataloader=testloader,
save_dir=save_dir,
verbose=nc < 50 and final_epoch,
plots=plots and final_epoch,
log_imgs=opt.log_imgs if wandb else 0,
compute_loss=compute_loss)
Expand Down

0 comments on commit 58149a9

Please sign in to comment.