Skip to content

Commit

Permalink
set bs to 1 if inference (#1594)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaiBapchya authored Jan 23, 2021
1 parent ecf4916 commit 426a8f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gluoncv/model_zoo/rcnn/mask_rcnn/mask_rcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ def hybrid_forward(self, F, x):
# (B * N, C, MS, MS)
x = self.mask(x)
# (B * N, C, MS, MS) -> (B, N, C, MS, MS)
x = x.reshape((-4, self._batch_images, -1, 0, 0, 0))
if autograd.is_training():
x = x.reshape((-4, self._batch_images, -1, 0, 0, 0))
else:
# always use batch_size = 1 for inference
x = x.reshape((-4, 1, -1, 0, 0, 0))
return x

def reset_class(self, classes, reuse_weights=None):
Expand Down

0 comments on commit 426a8f9

Please sign in to comment.