Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Fixing IndexError on grouped_batch_sampler.py #656

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion maskrcnn_benchmark/data/samplers/grouped_batch_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _prepare_batches(self):
# the order that we have in the sampler. For that, we will consider the
# ordering as coming from the first element of each batch, and sort
# correspondingly
first_element_of_batch = [t[0].item() for t in merged]
first_element_of_batch = [t[0].item() for t in merged if t.numel() > 0]
# get and inverse mapping from sampled indices and the position where
# they occur (as returned by the sampler)
inv_sampled_ids_map = {v: k for k, v in enumerate(sampled_ids.tolist())}
Expand Down