Skip to content

Commit

Permalink
RandomIdentitySampler: n_pids should be larger than n_pids_to_sample
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiyangZhou committed Apr 11, 2021
1 parent 849d08b commit ea41e69
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions torchreid/data/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self, data_source, batch_size, num_instances):
pid = items[1]
self.index_dic[pid].append(index)
self.pids = list(self.index_dic.keys())
assert len(self.pids) >= self.num_pids_per_batch

# estimate number of examples in an epoch
# TODO: improve precision
Expand Down

0 comments on commit ea41e69

Please sign in to comment.