Skip to content

Commit d65190b

Browse files
author
Bhargav Kowshik
committed
Assert image resolution has to be divisible by 32 for resnet
1 parent d33ae08 commit d65190b

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)