Unverified Commit 1d5dac76 authored by Julian Schoep's avatar Julian Schoep Committed by GitHub
Browse files

fix: fix TypeError in ROI subsampling function (#893)

* fix TypeError in ROI subsampling function

* add comment
parent a35f4297
...@@ -145,7 +145,7 @@ class ProposalTargetLayer(nn.Module): ...@@ -145,7 +145,7 @@ class ProposalTargetLayer(nn.Module):
rand_num = np.floor(np.random.rand(self.roi_sampler_cfg.ROI_PER_IMAGE) * fg_num_rois) rand_num = np.floor(np.random.rand(self.roi_sampler_cfg.ROI_PER_IMAGE) * fg_num_rois)
rand_num = torch.from_numpy(rand_num).type_as(max_overlaps).long() rand_num = torch.from_numpy(rand_num).type_as(max_overlaps).long()
fg_inds = fg_inds[rand_num] fg_inds = fg_inds[rand_num]
bg_inds = [] bg_inds = fg_inds[fg_inds < 0] # yield empty tensor
elif bg_num_rois > 0 and fg_num_rois == 0: elif bg_num_rois > 0 and fg_num_rois == 0:
# sampling bg # sampling bg
......
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