Swin-Transformer icon indicating copy to clipboard operation
Swin-Transformer copied to clipboard

Some questions about the code

Open HC-2016 opened this issue 3 years ago • 3 comments

1 why do you construct the val sampler as a random sampler rather than a sequence sampler? It may be inconvenient when inferencing on test data. https://github.com/microsoft/Swin-Transformer/blob/777f6c66604bb5579086c4447efe3620344d95a9/data/build.py#L41 https://github.com/microsoft/Swin-Transformer/blob/777f6c66604bb5579086c4447efe3620344d95a9/data/samplers.py#L23

2 The organization of the stage in the code seems to be different with the organization illustrateed in the paper. The organization of the stage in the code: 815ffe0211774c3bf79b670d36783ff9

    def forward(self, x):
        for blk in self.blocks:
            if self.use_checkpoint:
                x = checkpoint.checkpoint(blk, x)
            else:
                x = blk(x)
        if self.downsample is not None:
            x = self.downsample(x)
        return x

HC-2016 avatar Oct 07 '21 01:10 HC-2016

i have the same question, the outputs of each stage are [bs, H/8, W/8, 2C], [bs, H/16, W/16, 4C], [bs, H/32, W/32, 8C], [bs, H/32, W/32, 8C]

kingkung2016 avatar Nov 03 '21 09:11 kingkung2016

Thanks for point out these issues @HC-2016 . We will fix both of them.

ancientmooner avatar Dec 20 '21 10:12 ancientmooner

Wow, the same question with Q2. To be honest, the code implementation is quite confusing. WHY put the patch merging module at last? It's really inconvinient to extract multi-level features based on this repo.

k-zha14 avatar Jan 16 '22 16:01 k-zha14