-
Notifications
You must be signed in to change notification settings - Fork 32
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
ValueError: cannot reshape array of size 0 into shape (0,newaxis) #11
Comments
Update: this bug has been fixed in the latest build: The error message is misleading since this error is related to the This will fail: # create metric_fn
metric_fn = MeanAveragePrecision(num_classes=3)#<-see here
# [xmin, ymin, xmax, ymax, class_id, difficult, crowd]
gt = np.array([
[439, 157, 556, 241, 0, 0, 0],
])
# [xmin, ymin, xmax, ymax, class_id, confidence]
preds = np.array([
[429, 219, 528, 247, 0, 0.460851],
[433, 260, 506, 336, 1, 0.269833], #<-see here: only 2 classes present in the preds
])
# add some samples to evaluation
for i in range(10):
metric_fn.add(preds, gt)
But this is OK: # create metric_fn
metric_fn = MeanAveragePrecision(num_classes=2) #<-see here
# [xmin, ymin, xmax, ymax, class_id, difficult, crowd]
gt = np.array([
[439, 157, 556, 241, 0, 0, 0],
])
# [xmin, ymin, xmax, ymax, class_id, confidence]
preds = np.array([
[429, 219, 528, 247, 0, 0.460851],
[433, 260, 506, 336, 1, 0.269833], #<-see here: both 2 classes present in the preds
])
# add some samples to evaluation
for i in range(10):
metric_fn.add(preds, gt) |
Hi, thanks for your feedback. |
I still have the problem above while having 0.0.2.1 (installed with
Moreover, there are addtional labels Now, shall I set |
When will you upload the newest package to |
it is now live! https://pypi.org/project/mean-average-precision/2021.4.23.0/ Thanks! |
This might not be the better place for it, but I keep getting this error when adding the predictions and gt:
From the traceback, the issue seems to be happening here:
difficult = np.repeat(gt[:, 5], preds.shape[0], axis=0).reshape(preds[:, 5].shape[0], -1).tolist()
But if perform it manually:
I don't get any error at all:
The text was updated successfully, but these errors were encountered: