ViPC icon indicating copy to clipboard operation
ViPC copied to clipboard

could training batch size=1 be changed?

Open doldolOuO opened this issue 2 years ago • 1 comments

From the code file train.py, the batch of training is 1, can it be modified? eg: batch size=32

doldolOuO avatar Mar 24 '23 07:03 doldolOuO

I try to modify the code. For projection, I chose to iterate batch_size, so that during the operation of the entire network, batch_size can be selected to be greater than 1.

img_proj_feat = []
        for bs in range(0, batch_size):
            level0 = levels0[bs,:]
            level0_squeeze = torch.squeeze(level0)
            feat = self.projection(bs, img_feats, level0_squeeze)
            img_proj_feat.append(feat)
        img_proj_feat = torch.stack(img_proj_feat)
        img_proj_feat = self.fc(img_proj_feat.unsqueeze(0).view(batch_size,-1)).view(batch_size,3,-1)

duzhenjiang113 avatar Sep 20 '23 07:09 duzhenjiang113