Skip to content

Commit 495edfb

Browse files
authored
Merge pull request #104 from mapbox/assert-resolution
Assert image resolution has to be divisible by 32 for resnet
2 parents d33ae08 + d65190b commit 495edfb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

robosat/unet.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ def forward(self, x):
116116
Returns:
117117
The networks output tensor.
118118
"""
119+
size = x.size()
120+
assert size[-1] % 32 == 0 and size[-2] % 32 == 0, "image resolution has to be divisible by 32 for resnet"
119121

120122
enc0 = self.resnet.conv1(x)
121123
enc0 = self.resnet.bn1(enc0)

0 commit comments

Comments
 (0)