CSG icon indicating copy to clipboard operation
CSG copied to clipboard

model.train() instead of model.eval()? Or I'm missing something!

Open AliLotfi92 opened this issue 3 years ago • 3 comments

https://github.com/NVlabs/CSG/blob/175ecdf748fcaf7c84de7b1c2578dbc01821c483/train.py#L211

AliLotfi92 avatar May 10 '22 04:05 AliLotfi92

Hi @AliLotfi92,

Thanks for your interest in our work!

We use model.eval() because we want to keep the BN statistics learned in the pretrained checkpoint (e.g. from ImageNet) remain intact during the synthetic training. In other words, we want to avoid the BN from being affected by the features on the synthetic images.

chenwydj avatar May 10 '22 04:05 chenwydj

thanks for your response. That makes much more sense now. For train_seq.py you have this: https://github.com/NVlabs/CSG/blob/175ecdf748fcaf7c84de7b1c2578dbc01821c483/train_seg.py#L193 shouldn't it be the same for the classification task too?

AliLotfi92 avatar May 14 '22 21:05 AliLotfi92

@AliLotfi92 The fc_new is learning features from the new domain. It is randomly initialized, instead of having a pretrained checkpoint to load from.

chenwydj avatar May 22 '22 02:05 chenwydj