Unverified Commit d74fad1a authored by Francisco Massa's avatar Francisco Massa Committed by GitHub

Raise error if no GT or proposals available during training (#37)

parent 38ce7a10
...@@ -51,9 +51,15 @@ class Matcher(object): ...@@ -51,9 +51,15 @@ class Matcher(object):
be matched. be matched.
""" """
if match_quality_matrix.numel() == 0: if match_quality_matrix.numel() == 0:
# handle empty case # empty targets or proposals not supported during training
device = match_quality_matrix.device if match_quality_matrix.shape[0] == 0:
return torch.empty((0,), dtype=torch.int64, device=device) raise ValueError(
"No ground-truth boxes available for one of the images "
"during training")
else:
raise ValueError(
"No proposal boxes available for one of the images "
"during training")
# match_quality_matrix is M (gt) x N (predicted) # match_quality_matrix is M (gt) x N (predicted)
# Max over gt elements (dim 0) to find best gt candidate for each prediction # Max over gt elements (dim 0) to find best gt candidate for each prediction
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment