MVCNN-PyTorch icon indicating copy to clipboard operation
MVCNN-PyTorch copied to clipboard

Not using multiple images

Open HutHan12 opened this issue 1 year ago • 0 comments

Hello author

I tried to obtain the size of the network input tensor in your code with a batch size of 4, and the result was [4,1,3,224,224]. The view pool obtained through network processing only has one image. Therefore, have you considered the impact of this issue on the overall experimental results. Thank you very much.

batch_size=4, 10epochs print one iter. Example code: def forward(self, x): # Swap batch and views dims print(x.shape) x = x.transpose(0, 1)

    # View pool
    view_pool = []
    for v in x:
        v = self.conv1(v)
        v = self.bn1(v)
        v = self.relu(v)
        v = self.maxpool(v)

        v = self.layer1(v)
        v = self.layer2(v)
        v = self.layer3(v)
        v = self.layer4(v)

        v = self.avgpool(v)
        v = v.view(v.size(0), -1)

        view_pool.append(v)

    print(len(view_pool))
    pooled_view = view_pool[0]
    for i in range(1, len(view_pool)):
        pooled_view = torch.max(pooled_view, view_pool[i])
    pooled_view = self.fc(pooled_view)
    
    return pooled_view

Console outputs: Epoch: [1/100] torch.Size([4, 1, 3, 224, 224]) 1 torch.Size([4, 1, 3, 224, 224]) 1 torch.Size([4, 1, 3, 224, 224]) 1 torch.Size([4, 1, 3, 224, 224]) 1 torch.Size([4, 1, 3, 224, 224]) 1 torch.Size([4, 1, 3, 224, 224]) 1 torch.Size([4, 1, 3, 224, 224]) 1 torch.Size([4, 1, 3, 224, 224]) 1 torch.Size([4, 1, 3, 224, 224]) 1 torch.Size([4, 1, 3, 224, 224]) 1 Iter [10/9549] Loss: 4.7128

HutHan12 avatar Apr 11 '23 01:04 HutHan12