Skip to content

Commit

Permalink
Assert image resolution has to be divisible by 32 for resnet in fpn
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhargav Kowshik authored and daniel-j-h committed Oct 15, 2018
1 parent 7d8bed5 commit 8876768
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions robosat/fpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def __init__(self, num_filters=256, pretrained=True):
def forward(self, x):
# Bottom-up pathway, from ResNet

size = x.size()
assert size[-1] % 32 == 0 and size[-2] % 32 == 0, "image resolution has to be divisible by 32 for resnet"

enc0 = self.resnet.conv1(x)
enc0 = self.resnet.bn1(enc0)
enc0 = self.resnet.relu(enc0)
Expand Down

0 comments on commit 8876768

Please sign in to comment.