use dict instead of list
@@ -79,8 +79,8 @@ class Layer1(TheseusLayer):
def __init__(self, num_channels, has_se=False, name=None):
super(Layer1, self).__init__()
- self.bottleneck_block_list = nn.Sequential(*[
- BottleneckBlock(
+ self.bottleneck_block_list = nn.Sequential(*{
+ "bb_{}_{}".format(name, i + 1): BottleneckBlock(
num_channels=num_channels if i == 0 else 256,
num_filters=64,
has_se=has_se,
@@ -88,7 +88,7 @@ class Layer1(TheseusLayer):
downsample=True if i == 0 else False,
name=name + '_' + str(i + 1))
for i in range(4)
- ])
+ })
def forward(self, x, res_dict=None):
y = x
