Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Perform batch size check before converting scales #762

Merged
merged 2 commits into from
Feb 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion chainercv/links/model/faster_rcnn/faster_rcnn_train_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ def __call__(self, imgs, bboxes, labels, scales):
labels = labels.array
if isinstance(scales, chainer.Variable):
scales = scales.array
scales = cuda.to_cpu(scales)

n = bboxes.shape[0]
if n != 1:
raise ValueError('Currently only batch size 1 is supported.')
scales = cuda.to_cpu(scales)

_, _, H, W = imgs.shape
img_size = (H, W)
Expand Down