From 8876768ffdd5a5b6ed1ad6eec0b9b0e96a1f77ec Mon Sep 17 00:00:00 2001 From: Bhargav Kowshik Date: Fri, 10 Aug 2018 10:02:55 +0530 Subject: [PATCH] Assert image resolution has to be divisible by 32 for resnet in fpn --- robosat/fpn.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/robosat/fpn.py b/robosat/fpn.py index 8b3f0b49..5a323a7d 100644 --- a/robosat/fpn.py +++ b/robosat/fpn.py @@ -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)