caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Accuracy is close to 0 when training batch sizes are 64 and 1024

Open qingqing01 opened this issue 12 years ago • 5 comments

I just want to test caffe for different batch size. When batch sizes are 128, 256, 512, the accuracy results are right. But when the batch sizes are 64 and 1024, the accuracy is close to 0. Our platform information: CentOS release 6.3, K40,cuda-6.0. How can I solve this problem?

Thanks.

qingqing01 avatar Aug 07 '14 08:08 qingqing01

Probably need to adapt the learning rate accordingly.

On Thursday, August 7, 2014, Dcocoa [email protected] wrote:

I just want to test caffe for different batch size. When batch sizes are 128, 256, 512, the accuracy results are right. But when the batch sizes are 64 and 1024, the accuracy is close to 0. Our platform information: CentOS release 6.3, K40,cuda-6.0. How can I solve this problem?

Thanks.

— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/877.

Sergio

sguada avatar Aug 07 '14 09:08 sguada

I also met with this problem. Sometimes, I have met another problem. When the batchsize number and learning rate was Ok for fixed number of class (such as 150), these parameters didnlt work for other class number (such as 300 classed). Why this happens and how should i do?

davidduo avatar Aug 07 '14 14:08 davidduo

Hi, @davidduo , have you find solution for fix this problem? I also want to know how to change parameters for training my own data (10 classes).

Cheng-Wang avatar Aug 11 '14 13:08 Cheng-Wang

@Cheng-Wang sorry, havn't fixed it

davidduo avatar Aug 11 '14 16:08 davidduo

SGD isn't magic and requires tuning. For further understanding of the optimization and divergence, and what gradient variance, minibatch size, and learning rate have to do with it, read:

[1] L. Bottou. Stochastic gradient tricks. In G. Montavon, G. B. Orr, and K.-R. Mu ̈ller, editors, Neural Networks, Tricks of the Trade, Reloaded, Lecture Notes in Computer Science (LNCS 7700), pages 430– 445. Springer, 2012.

Please continue the discussion on the caffe-users mailing list. As of the latest release we prefer to keep issues reserved for Caffe development. Thanks!

shelhamer avatar Aug 11 '14 22:08 shelhamer