InsightFace_Pytorch icon indicating copy to clipboard operation
InsightFace_Pytorch copied to clipboard

Do huge batch size necessary?

Open Jasonbaby opened this issue 7 years ago • 8 comments

Hi, I have tried to retrained the model with batch size 50, But it seems the model do not converge. I am wondering if the batch size is needed to be huge (more than 100)?

Jasonbaby avatar Dec 12 '18 04:12 Jasonbaby

I don't think so, maybe you need to tune your lr if you change the batchsize

TreB1eN avatar Dec 12 '18 04:12 TreB1eN

and about convergence, it will not converge at all after several epoches

TreB1eN avatar Dec 12 '18 04:12 TreB1eN

Thanks a lot. Actually, I have trained 3 epoches, with emore dataset. And the loss does not decrease at all. Is it ok? So I continue my training? I had changed some codes, but not changed the Arcface head.

Jasonbaby avatar Dec 16 '18 11:12 Jasonbaby

I changed the backbone model, and the re-train the model with emore dataset.

Jasonbaby avatar Dec 16 '18 12:12 Jasonbaby

that's not OK, the loss should start to decrease at very early stage

TreB1eN avatar Dec 16 '18 12:12 TreB1eN

Thanks a lot. I will recheck my code.

Jasonbaby avatar Dec 16 '18 14:12 Jasonbaby

@Jasonbaby Have u solved the problem? I am also training with small batch size 64 with r34 backbone and it is not converging.

yxchng avatar Mar 02 '19 10:03 yxchng

I think the batch size need to be large, since there are a lot of batch normalization in mobileFaceNet.

joe-zxh avatar Aug 24 '22 10:08 joe-zxh