Unverified Commit 46f6083b authored by Aditya Oke's avatar Aditya Oke Committed by GitHub
Browse files

Changes to assert to ValueError in achor utils (#2960)

* changes to value error

* fixes it :)

* simpler fix
parent 7f7ff056
......@@ -100,7 +100,12 @@ class AnchorGenerator(nn.Module):
anchors = []
cell_anchors = self.cell_anchors
assert cell_anchors is not None
assert len(grid_sizes) == len(strides) == len(cell_anchors)
if not (len(grid_sizes) == len(strides) == len(cell_anchors)):
raise ValueError("Achors should be Tuple[Tuple[int]] because each feature "
"map could potentially have different sizes and aspect ratios. "
"There needs to be a match between the number of "
"feature maps passed and the number of sizes / aspect ratios specified.")
for size, stride, base_anchors in zip(
grid_sizes, strides, cell_anchors
......
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