Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gau-nernst committed Jul 7, 2023
1 parent a764334 commit 5925030
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions vision_toolbox/backbones/vovnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(
[ConvNormAct(in_channels if i == 0 else mid_channels, mid_channels) for i in range(num_layers)]
)
concat_channels = in_channels + mid_channels * num_layers
self.out_conv = ConvNormAct(concat_channels, out_channels, kernel_size=1, padding=0)
self.out_conv = ConvNormAct(concat_channels, out_channels, 1)

self.ese = ESEBlock(out_channels) if ese else None
self.residual = residual and (in_channels == out_channels)
Expand Down Expand Up @@ -160,7 +160,7 @@ def __init__(
in_c = stem_channels
for n, stage_c, n_l, out_c in zip(num_blocks_list, stage_channels_list, num_layers_list, out_channels_list):
stage = nn.Sequential()
stage.add_module("max_pool", nn.MaxPool2d(3, 2, padding=1))
stage.add_module("max_pool", nn.MaxPool2d(3, 2, 1))
for i in range(n):
stage.add_module(
f"module_{i}",
Expand Down
4 changes: 1 addition & 3 deletions vision_toolbox/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from torchvision.ops import DeformConv2d


__all__ = ["ConvNormAct", "SeparableConv2d", "DeformableConv2d", "ESEBlock", "SPPBlock"]
__all__ = ["ConvNormAct", "SeparableConv2d", "DeformableConv2d", "SPPBlock"]


class ConvNormAct(nn.Sequential):
Expand All @@ -22,8 +22,6 @@ def __init__(
norm: str = "bn",
act: str = "relu",
):
if kernel_size % 2 == 0:
raise ValueError("Even kernel is not supported")
super().__init__()
self.conv = nn.Conv2d(
in_channels,
Expand Down

0 comments on commit 5925030

Please sign in to comment.