Skip to content

Commit

Permalink
Reformatted
Browse files Browse the repository at this point in the history
  • Loading branch information
senarvi committed Aug 19, 2021
1 parent 191e865 commit 66c8111
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pl_bolts/models/detection/yolo/yolo_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,12 @@ def _validate_batch(
if not isinstance(boxes, Tensor):
raise ValueError(f"Expected target boxes to be of type Tensor, got {type(boxes)}.")
if (len(boxes.shape) != 2) or (boxes.shape[-1] != 4):
raise ValueError(
f"Expected target boxes to be tensors of shape [N, 4], got {list(boxes.shape)}."
)
raise ValueError(f"Expected target boxes to be tensors of shape [N, 4], got {list(boxes.shape)}.")
labels = target["labels"]
if not isinstance(labels, Tensor):
raise ValueError(f"Expected target labels to be of type Tensor, got {type(labels)}.")
if len(labels.shape) != 1:
raise ValueError(
f"Expected target labels to be tensors of shape [N], got {list(labels.shape)}."
)
raise ValueError(f"Expected target labels to be tensors of shape [N], got {list(labels.shape)}.")

images = torch.stack(images)
return images, targets
Expand Down

0 comments on commit 66c8111

Please sign in to comment.