prlz77 / ResNeXt.pytorch

Reproduces ResNet-V3 with pytorch
MIT License
505 stars 121 forks source link

The structure problem #16

Closed Snowball0823 closed 5 years ago

Snowball0823 commented 5 years ago

self.stage_1 = self.block('stage_1', self.stages[0], self.stages[1], 1) self.stage_2 = self.block('stage_2', self.stages[1], self.stages[2], 2) self.stage_3 = self.block('stage_3', self.stages[2], self.stages[3], 2) self.classifier = nn.Linear(self.stages[3], nlabels) . . . for bottleneck in range(self.blockdepth): name = '%sbottleneck%d' % (name, bottleneck) if bottleneck == 0: block.addmodule(name, ResNeXtBottleneck(in_channels, out_channels, pool_stride, self.cardinality, self.base_width, self.widen_factor)) else: block.addmodule(name, ResNeXtBottleneck(out_channels, out_channels, 1, self.cardinality, self.base_width, self.widen_factor)) The structure of net is strange I see the Lua source code, it seems that there should have a maxpooling before stage_1? And the source code use the resnet structure to build the resneXt, but in your code, you use the same block number in every stage, but the resnet use four layers and use different block number in every layer, and there only have three stage, so is this the mistake?