bfortuner / pytorch_tiramisu

FC-DenseNet in PyTorch for Semantic Segmentation
MIT License
306 stars 66 forks source link

Found a waste line in models/tiramisu.py #21

Open truebelief opened 5 years ago

truebelief commented 5 years ago

The line 60 in your code, tiramisu.py, : cur_channels_count += prev_block_channels actually does nothing, since the cur_channels_count is overwritten before and after. Please consider removing it, since it is confusing and misleading.

         #######################
        #   Upsampling path   #
        #######################

        self.transUpBlocks = nn.ModuleList([])
        self.denseBlocksUp = nn.ModuleList([])
        for i in range(len(up_blocks)-1):
            self.transUpBlocks.append(TransitionUp(prev_block_channels, prev_block_channels))
            cur_channels_count = prev_block_channels + skip_connection_channel_counts[i]

            self.denseBlocksUp.append(DenseBlock(
                cur_channels_count, growth_rate, up_blocks[i],
                    upsample=True))
            prev_block_channels = growth_rate*up_blocks[i]
            cur_channels_count += prev_block_channels