From a95e47533adcaed9002b5f12ba5312258096e2aa Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 17 Apr 2019 16:11:26 +0200 Subject: [PATCH] updates --- test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test.py b/test.py index 6e4d4654..4f70d297 100644 --- a/test.py +++ b/test.py @@ -69,8 +69,9 @@ def test( inf_out, train_out = model(imgs) # inference and training outputs # Compute loss - loss_i, _ = compute_loss(train_out, targets, model) - loss += loss_i.item() + if hasattr(model, 'hyp'): # if model has loss hyperparameters + loss_i, _ = compute_loss(train_out, targets, model) + loss += loss_i.item() # Run NMS output = non_max_suppression(inf_out, conf_thres=conf_thres, nms_thres=nms_thres)