Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error while test #284

Closed
1518136851 opened this issue Aug 22, 2019 · 4 comments
Closed

error while test #284

1518136851 opened this issue Aug 22, 2019 · 4 comments

Comments

@1518136851
Copy link

$ python test.py --weights_path weights/yolov3.weights
Detecting objects: 0it [00:01, ?it/s]
Namespace(batch_size=8, class_path='data/coco.names', conf_thres=0.001, data_config='config/coco.data', img_size=416, iou_thres=0.5, model_def='config/yolov3.cfg', n_cpu=8, nms_thres=0.5, weights_path='weights/yolov3.weights')
Compute mAP...
Traceback (most recent call last):
File "test.py", line 98, in
batch_size=8,
File "test.py", line 53, in evaluate
true_positives, pred_scores, pred_labels = [np.concatenate(x, 0) for x in list(zip(*sample_metrics))]
ValueError: not enough values to unpack (expected 3, got 0)

@JeasonUESTC
Copy link

Hi, I miss to the same problem and have you solve this problem?

@ramondoo
Copy link

ramondoo commented Sep 8, 2019

if len(sample_metrics) > 0:
    true_positives, pred_scores, pred_labels = [np.concatenate(x, 0) for x in list(zip(*sample_metrics))]
    precision, recall, AP, f1, ap_class = ap_per_class(true_positives, pred_scores, pred_labels, labels)
    assert len(ap_class) == len(AP)
else:
    ap_class = np.unique(labels).astype("int32")
    precision = np.zeros(len(ap_class), dtype=np.float)
    recall = precision
    AP = precision
    f1 = 2 * precision * recall / (precision + recall + 1e-16)

@summeryumyee
Copy link

Thank you ~~~

@Flova
Copy link
Collaborator

Flova commented Aug 2, 2021

This part of the code has been updated or removed. I, therefore, close this issue now. Feel free to reopen for further discussion.

@Flova Flova closed this as completed Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants