Hydrogenion / ViPC

PyTorch implementation for View-Guided Point Cloud Completion
MIT License
47 stars 7 forks source link

could training batch size=1 be changed? #16

Open doldolOuO opened 1 year ago

doldolOuO commented 1 year ago

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

duzhenjiang113 commented 1 year ago

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)